«example with sc» by tonetron
on 31 Oct'11 14:33 inFrom Kyoto city in Japan.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
s.boot; /*SynthDef section*/ ( SynthDef(\raintree02, {arg freq,amp,pan; var out, env; env = Env.perc(0.01,0.5); out = SinOsc.ar(freq.midicps,0,1.0) * EnvGen.kr(env, doneAction: 2); out = Pan2.ar(out, pan); out = FreeVerb.ar(out, 0.3,0.3,0.1,amp); Out.ar(0, out); }).send(s); ) /*Task section*/ ( var midiArray = [ [31,38,41,44,48,52] ,[33,38,45,48,51,55],[35,42,44,45,48,52] ]; var midi; var taskArray = [ 0,0 ]; Task({ inf.do({arg num1; if( (num1+1).mod(4) == 0,{ midiArray = midiArray.scramble; midiArray = midiArray + 1.rand2; }); midi = midiArray.wrapAt(num1); num1.postln; midi.postln; taskArray.wrapAt(num1).stop; taskArray.wrapPut(num1, Task({ inf.do({arg num2; var oct; oct = [0,12,24,36].wchoose( [0.2,0.25,0.3,0.25]); Synth(\raintree02,[ \freq, midi.wrapAt(num2)+oct, \amp, rrand(0.05, 0.4), \pan, [-0.8,0.8].wrapAt(num1); ]); if( (num2+1).mod(40) == 0,{ midi = midi.scramble; }); 0.25.wait; }) }).start; ); 20.wait; }) }).start; )
reception
comments