ServerOptions: different input & output device names only works on osx
[supercollider.git] / examples / demonstrations / Theremin.scd
blobd33cad640685c153af1fbf65a4ba63b2c3dd9ccb
2 ////////  the theremin ////////
4 // playing only one instance:
6 play(
7         {
8                 var f;
9                 f = MouseY.kr(4000, 200, 'exponential', 0.8);
10                 SinOsc.ar(
11                         freq: f+ (f*SinOsc.ar(7,0,0.02)),
12                         mul: MouseX.kr(0, 0.9)
13                 )
14         }
19 // building a synthdef and spawning separate synths
22 SynthDef(\theremin, { arg mod = 7, detune = 0;
23         var f, a, z;
24         f = MouseY.kr(4000, 200, 'exponential', 0.8) + detune;
25         a = SinOsc.ar(f + (f * SinOsc.ar(mod,0,0.02)), mul: MouseX.kr(0, 0.9));
26         z = Mix.ar(a);
27         Out.ar(0, z) + Out.ar(1, z)
28 }).add
31 a = Synth(\theremin);
32 a.set(\mod, 12);
34 b = Synth(\theremin);
35 b.set(\mod, 5, \detune, 200); 
37 a.free;
38 b.free;