*** empty log message ***
[chuck-blob.git] / v2 / examples / basic / foo2.ck
blob4f85e58bf5294b1a199d3d0e236c8aa10e8b1ac6
1 // bandlimited ugens (Blit, BlitSaw, BlitSquare)
2 Blit s => Pan2 p;
3 p.left => JCRev r1 => dac.left;
4 p.right => JCRev r2 => dac.right;
6 // initial settings
7 .5 => s.gain;
8 .1 => r1.mix;
9 .1 => r2.mix;
11 // an array
12 [ 0, 2, 4, 7, 9, 11 ] @=> int hi[];
14 // set the harmonic
15 4 => s.harmonics;
17 // spork the pan control
18 spork ~ dopan();
20 // infinite time loop
21 while( true )
23     Std.mtof( 33 + Std.rand2(0,3) * 12 +
24         hi[Std.rand2(0,hi.cap()-1)] ) => s.freq;
25     120::ms => now;
28 // pan control
29 fun void dopan()
31     float t;
32     while( true )
33     {
34         .7 * Math.sin(t) => p.pan;
35         .005 +=> t;
36         10::ms => now;
37     }