Debian Codegraph @

examples/multi/i.ck

raw
1 // name: i.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 int i;
14
15 // make osc bank
16 Impulse s[N];
17 // connect to individual channels
18 for( int i; i < N; i++ )
19 {
20 s[i] => dac.chan(i);
21 // .5 => s[i].gain;
22 }
23
24 // go
25 while( true )
26 {
27 1 => s[i].next;
28 100::ms => now;
29 (i+1)%N => i;
30 }