Debian Codegraph @

examples/stereo/array.ck

raw
1 // dope storm
2 // using arrays as UGen busses
3 // author: Spencer Salazar - [email protected]
4 // date: May 2013
5
6 // patch mixing arrays of mono and stereo UGens
7 SndBuf buf[32] => Pan2 pan[32] => NRev reverb[2] => dac;
8
9 // set reverb mix
10 0.1 => reverb[0].mix;
11 0.11 => reverb[1].mix;
12
13 // load sound
14 for( int i; i < buf.size(); i++ )
15 {
16 // load dope sound
17 "special:dope" => buf[i].read;
18 // set to end
19 buf[i].samples() => buf[i].pos;
20 }
21
22 // index
23 0 => int i;
24
25 while(true)
26 {
27 // randomize pan
28 Math.random2f(-0.5,0.5) => pan[i%pan.size()].pan;
29 // Math.pow(2, Math.random2f(-1.5, 1.5)) => buf[i%buf.size()].rate;
30
31 // reset playback position for a buf
32 0 => buf[i%buf.size()].pos;
33
34 // randomize time
35 Math.random2f(0.075, 0.125)::second => now;
36 //0.5::second => now;
37
38 // increment
39 i++;
40 }