*** empty log message ***
[chuck-blob.git] / v2 / examples / basic / wind2.ck
blobfcf522092b98f3d1a74005b694ac148131d7d5e7
1 // noise generator, biquad filter, dac (audio output) 
2 Noise n => BiQuad f => dac;
3 // set biquad pole radius
4 .99 => f.prad;
5 // set biquad gain
6 .05 => f.gain;
7 // set equal zeros 
8 1 => f.eqzs;
9 // our float
10 0.0 => float t;
12 // concurrent control
13 fun void wind_gain( )
15     0.0 => float g; 
17     // time loop to ramp up the gain / oscillate
18     while( true )
19     {
20         Std.fabs( Math.sin( g ) ) => n.gain;
21         g + .001 => g;
22         10::ms => now;
23     }
26 // run wind_gain on anothre shred
27 spork ~ wind_gain();
29 // infinite time-loop
30 while( true )
32     // sweep the filter resonant frequency
33     100.0 + Std.fabs(Math.sin(t)) * 15000.0 => f.pfreq;
34     t + .01 => t;
35     // advance time
36     100::ms => now;