Skip to content

Instantly share code, notes, and snippets.

@nulltask
Created February 21, 2012 12:25
Show Gist options
  • Select an option

  • Save nulltask/1876218 to your computer and use it in GitHub Desktop.

Select an option

Save nulltask/1876218 to your computer and use it in GitHub Desktop.
SuperCollider Workshop (Day 1)
{
Server.local.makeGui;
Server.internal.makeGui;
}
// SinOsc: unit generator
// ar, audio-rate
{ SinOsc.ar(440, 0, 0.3) }.play();
// { } = function object
{ Pulse.ar(500, 0.01, 0.3) }.play();
// case sensitive
// NG
// { pluse.ar() }.play();
(
SynthDef(\testSynth, {
Out.ar(0, // 0 or 1 = server
SinOsc.ar(440, 0.0, 0.3).dup(); // dup attach to channel 1
)
}).play;
)
(
var hotel;
hotel = 10000;
)
(
SynthDef(\sine_wave, { arg freq = 440, amp = 0.5;
var source;
source = SinOsc.ar(freq);
Out.ar(0, source * amp);
}).store();
)
a = Synth(\sine_wave);
a.free();
a = Synth(\sine_wave, [\freq, 220, \amp, 0.3]);
b = Synth(\sine_wave, [\freq, 440, \amp, 0.3]);
c = Synth(\sine_wave, [\freq, 880, \amp, 0.3]);
d = Synth(\sine_wave, [\freq, 220 * 4, \amp, 0.3]);
a.free();
b.free();
c.free();
d.free();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment