Debian Codegraph @

examples/multi/n.ck

raw
1 // name: n.ck
2 // desc: n-channel demo
3 // note: ChucK can be started with as much channels as is
4 // supported on the underlyding audio device; this can be
5 // done on command line (see chuck --help for more info)
6 // or in the miniAudicle Preferences (note changes will
7 // not take effect until the ChucK VM is (re)started
8
9 // number of channels
10 dac.channels() => int N;
11 // print
12 <<< "dac has", N, "channels" >>>;
13
14 // make osc bank
15 SinOsc s[N];
16 // connect to individual channels
17 for( int i; i < N; i++ )
18 {
19 s[i] => dac.chan(i);
20 Math.random2f( 400, 440 ) => s[i].freq;
21 .2 => s[i].gain;
22 }
23
24 // go
25 while( true ) 1::second => now;