Skip to content

Commit

Permalink
Merge supercollider-av (audiovisual) modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory Green committed Jun 22, 2019
1 parent 834c036 commit e235fe9
Show file tree
Hide file tree
Showing 17 changed files with 23,669 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ cmake-build-*

*~
*.orig
.tags
10 changes: 9 additions & 1 deletion HelpSource/Reference/Server-Command-Reference.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,15 @@ enum {

cmd_version = 64,

NUMBER_OF_COMMANDS = 65
// video server only
cmd_gl_newWindow = 65,
cmd_gl_freeWindow = 66,
cmd_gl_v_new = 67,
cmd_gl_v_free = 68,
cmd_gl_i_new = 69,
cmd_gl_i_free = 70,

NUMBER_OF_COMMANDS = 71 // 65 for non-video server
};
::

Expand Down
41 changes: 41 additions & 0 deletions SCClassLibrary/Common/Video/GL.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* Creates a new OpenGL context and window. */
GLWindow {
*new { arg windowID=0, width=640, height=480, server;
server = server ? Server.default;
^server.listSendMsg(["/gl_newWindow", windowID, width, height])
}

*free { arg windowID=0, server;
server = server ? Server.default;
^server.listSendMsg(["/gl_freeWindow", windowID])
}
}

GLVideo {
*new { arg vidID, filepath, rate=1.0, loop=true, targetWindow=0, server;
server = server ? Server.default;
^server.listSendMsg(["/gl_v_new", vidID, filepath, rate, loop, targetWindow])
}

*read { arg vidID, filepath, rate=1.0, loop=true, targetWindow=0, server;
server = server ? Server.default;
^server.listSendMsg(["/gl_v_read", vidID, filepath, rate, loop, targetWindow])
}

*free { arg vidID, targetWindow=0, server;
server = server ? Server.default;
^server.listSendMsg(["/gl_v_free", vidID, targetWindow])
}
}

GLImage {
*new { arg imgID, filepath, targetWindow=0, server;
server = server ? Server.default;
^server.listSendMsg(["/gl_i_new", imgID, filepath, targetWindow])
}

*free { arg imgID, targetWindow=0, server;
server = server ? Server.default;
^server.listSendMsg(["/gl_i_free", imgID, targetWindow])
}
}
35 changes: 35 additions & 0 deletions SCClassLibrary/Common/Video/SHK.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
SHKUGen : UGen {
*new { arg ... args;
^this.new1( *args );
}
}

SHKCheckerboard : SHKUGen {
*fr { arg in, rows, cols;
^this.new(\control, in, rows, cols)
}
}

SHKCircleWave : SHKUGen {
*fr { arg texture, time, speed, brightness, strength, density, center;
^this.new(\control, texture, time, speed, brightness, strength, density, center)
}
}

SHKColorInvert : SHKUGen {
*fr { arg in;
^this.new(\control, in)
}
}

SHKDesaturate : SHKUGen {
*fr { arg in, strength;
^this.new(\control, in, strength)
}
}

SHKWater : SHKUGen {
*fr { arg texture, time, speed, strength, frequency;
^this.new(\control, texture, time, speed, strength, frequency)
}
}
215 changes: 215 additions & 0 deletions SCClassLibrary/Common/Video/Video.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
VideoUGen : UGen {
*new { arg ... args;
^this.new1( *args );
}
}

GLRed : VideoUGen {
*fr { arg in, red;
^this.new(\control, in, red)
}
}

GLGreen : VideoUGen {
*fr { arg in, green;
^this.new(\control, in, green)
}
}

GLBlue : VideoUGen {
*fr { arg in, blue;
^this.new(\control, in, blue)
}
}

GLAlpha : VideoUGen {
*fr { arg in, alpha;
^this.new(\control, in, alpha)
}
}

GLOpacity : VideoUGen {
*fr { arg in, opacity;
^this.new(\control, in, opacity)
}
}

GLWhite : VideoUGen {
*fr {
^this.new(\control)
}
}

GLOut : VideoUGen {
*fr { arg in;
^this.new(\control, in)
}
}

GLPlayImg : VideoUGen {
*fr { arg imgID;
^this.new(\control, imgID)
}
}

GLPlayVid : VideoUGen {
*fr { arg vidID;
^this.new(\control, vidID)
}
}

GLPrevFrame : VideoUGen {
*fr {
^this.new(\control)
}
}

GLPrevFrame2 : VideoUGen {
*fr { arg coords;
^this.new(\control, coords)
}
}

GLRGB : VideoUGen {
*fr { arg in, r, g, b;
^this.new(\control, in, r, g, b)
}
}

GLRGBA : VideoUGen {
*fr { arg in, r, g, b, a;
^this.new(\control, in, r, g, b, a)
}
}

GLMix : VideoUGen {
*fr { arg in1, in2, mix;
^this.new(\control, in1, in2, mix)
}
}

GLBlend : VideoUGen {
*fr { arg backdrop, source, blendMode=0, mixVal=1;
^this.new(\control, backdrop, source, blendMode, mixVal)
}
}

GLShowImgTex : VideoUGen {
*fr { arg imgID, coords;
^this.new(\control, imgID, coords)
}
}

GLShowVidTex : VideoUGen {
*fr { arg vidID, coords;
^this.new(\control, vidID, coords)
}
}

GLTexCoords : VideoUGen {
*fr {
^this.new(\control)
}
}

GLTexFlipX : VideoUGen {
*fr { arg in;
^this.new(\control, in)
}
}

GLTexFlipY : VideoUGen {
*fr { arg in;
^this.new(\control, in)
}
}

GLTexMirrorX : VideoUGen {
*fr { arg in, mirrorXPos, polarity=0;
^this.new(\control, in, mirrorXPos, polarity)
}
}

GLTexMirrorY : VideoUGen {
*fr { arg in, mirrorYPos, polarity=0;
^this.new(\control, in, mirrorYPos, polarity)
}
}

GLTexScale : VideoUGen {
*fr { arg in, scaleX=1, scaleY=1;
^this.new(\control, in, scaleX, scaleY)
}
}

GLTexTrans : VideoUGen {
*fr { arg in, translateX=0, translateY=0;
^this.new(\control, in, translateX, translateY)
}
}

GLRotate : VideoUGen {
*fr { arg coords, angle;
^this.new(\control, coords, angle)
}
}

GLFunc1 : VideoUGen {
*fr { arg arg1;
^this.new(\control, arg1)
}
}

GLFunc2 : VideoUGen {
*fr { arg arg1, arg2;
^this.new(\control, arg1, arg2)
}
}

GLFunc3 : VideoUGen {
*fr { arg arg1, arg2, arg3;
^this.new(\control, arg1, arg2, arg3)
}
}

GLFunc4 : VideoUGen {
*fr { arg arg1, arg2, arg3, arg4;
^this.new(\control, arg1, arg2, arg3, arg4)
}
}

GLFunc5 : VideoUGen {
*fr { arg arg1, arg2, arg3, arg4, arg5;
^this.new(\control, arg1, arg2, arg3, arg4, arg5)
}
}

GLFunc6 : VideoUGen {
*fr { arg arg1, arg2, arg3, arg4, arg5, arg6;
^this.new(\control, arg1, arg2, arg3, arg4, arg5, arg6)
}
}

GLFunc7 : VideoUGen {
*fr { arg arg1, arg2, arg3, arg4, arg5, arg6, arg7;
^this.new(\control, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
}
}

GLFunc8 : VideoUGen {
*fr { arg arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8;
^this.new(\control, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
}
}

GLFunc9 : VideoUGen {
*fr { arg arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9;
^this.new(\control, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
}
}

GLFunc10 : VideoUGen {
*fr { arg arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10;
^this.new(\control, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
}
}
Loading

0 comments on commit e235fe9

Please sign in to comment.