File: i.ck

package info (click to toggle)
chuck 1.5.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 41,260 kB
  • sloc: cpp: 124,539; ansic: 35,893; javascript: 2,111; yacc: 609; makefile: 457; python: 174; perl: 86
file content (30 lines) | stat: -rw-r--r-- 669 bytes parent folder | download | duplicates (4)
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
// name: i.ck
// desc: n-channel demo
// note: ChucK can be started with as much channels as is
//       supported on the underlyding audio device; this can be
//       done on command line (see chuck --help for more info)
//       or in the miniAudicle Preferences (note changes will
//       not take effect until the ChucK VM is (re)started

// number of channels
dac.channels() => int N;
// print
<<< "dac has", N, "channels" >>>;
int i;

// make osc bank
Impulse s[N];
// connect to individual channels
for( int i; i < N; i++ )
{
    s[i] => dac.chan(i);
    // .5 => s[i].gain;
}

// go
while( true )
{
    1 => s[i].next;
    100::ms => now;
    (i+1)%N => i;
}