SuperCollider workshops SC cribsheet v0.1 CC-BY-SA-3 Dan Stowell //////////////////////////////////////////////////////////////////////////////// // Keyboard shortcuts: // mac: [Enter] or [ctrl+return] run line or selection, [ctrl+.] stop all. // vim: [F6] run line, [F5] run selection, [F12] stop all. // emacs: [ctrl+c][ctrl+c] run line, [ctrl+c][ctrl+d] run selection, [ctrl+c][ctrl+s] stop all. // win: [ctrl+enter] run line or selection, [alt+.] stop all. // gedit: [ctrl+e] run line or selection, [escape] stop all. //////////////////////////////////////////////////////////////////////////////// // Boot the server if you want sound: s.boot; // For quick prototyping, {...}.play creates a one-off synth. // (Curly brackets {} always indicate a Function.) x = {SinOsc.ar(330)}.play; x.free; x = {PinkNoise.ar(0.4)}.play x.free; x = {PinkNoise.ar(SinOsc.ar(1))}.play; x.free; x = { [PinkNoise.ar(0.4), SinOsc.ar(330)] }.play; // square brackets [] indicate an Array x.free; // as well as SinOsc try Pulse, Saw. as well as PinkNoise try WhiteNoise, BrownNoise... //////////////////////////////////////////////////////////////////////////////// // {}.play (above) is OK but not re-useable, and also hides some things. // Often we want to store a SynthDef for re-useable ( SynthDef('simple', { arg freq=440, amp=0.2, gate=1; // "arguments" are things we can control from outside Out.ar(0, Pulse.ar(freq, 0.2, amp)); FreeSelf.kr(1-gate); }).store; ) x = Synth('simple'); x.free; x = Synth('simple', ['freq', 330, 'amp', 0.4]); x.free; //////////////////////////////////////////////////////////////////////////////// // Patterns: p = Pbind('instrument', 'simple').play p.stop; // "Pseq" defines a sequential pattern. "Prand" is random order. p = Pbind('instrument','simple', 'dur', 0.2, 'freq', Pseq([64, 66, 67])).play p = Pbind('instrument','simple', 'dur', 0.2, 'midinote', Pseq([64, 66, 67])).play p = Pbind('instrument','simple', 'dur', Pseq([1, 0.2, 0.5]), 'midinote', 69).play // Many more, e.g.: Pwhite, Pshuf, Pxrand // ...see the help files for more (e.g. "A Practical Guide to Patterns" tutorial)