*** empty log message ***
[chuck-blob.git] / v2 / examples / stk / moog.ck
blob20e35c9026054995f9afece8ffbc5dd8b46b51c8
1 // STK ModalBar
3 // patch
4 Moog moog => dac;
6 // scale
7 [0, 2, 4, 7, 8, 11] @=> int scale[];
9 // infinite time loop
10 while( true )
12     // ding!
13     Std.rand2f( 0, 1 ) => moog.filterQ;
14     Std.rand2f( 0, 1 ) => moog.filterSweepRate;
15     Std.rand2f( 0, 12 ) => moog.lfoSpeed;
16     Std.rand2f( 0, 1 ) => moog.lfoDepth;
17     Std.rand2f( 0, 1 ) => moog.volume;
19     // print
20     <<< "---", "" >>>;
21     <<< "filterQ", moog.filterQ() >>>;
22     <<< "filter sweep rate:", moog.filterSweepRate() >>>;
23     <<< "lfo speed:", moog.lfoSpeed() >>>;
24     <<< "lfo depth:", moog.lfoDepth() >>>;
25     <<< "volume:", moog.volume() >>>;
27     // set freq
28     scale[Std.rand2(0,scale.cap()-1)] => int winner;
29     57 + Std.rand2(0,2)*12 + winner => Std.mtof => moog.freq;
31     // go
32     .8 => moog.noteOn;
34     // advance time
35     .5::second => now;