*** empty log message ***
[chuck-blob.git] / v2 / examples / stk / moog2.ck
blob2a556cd52778e69bc8bd5a8aecb813c1b5c01035
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, 128 ) => float filterQ;
14     Std.rand2f( 0, 128 ) => float filterSweep;
15     Std.rand2f( 0, 128 ) => float vol;
16     Std.rand2f( 0, 128 ) => float vibratoFreq;
17     Std.rand2f( 0, 128 ) => float vibratoGain;
19     moog.controlChange( 2, filterQ);
20     moog.controlChange( 4, filterSweep);
21     moog.controlChange( 11, vibratoFreq);
22     moog.controlChange( 1, vibratoGain);
23     moog.controlChange( 128, vol);
25     <<< "---", "" >>>;
26     <<< "filterQ", moog.filterQ() >>>;
27     <<< "filter sweep rate:", moog.filterSweepRate() >>>;
28     <<< "mod speed:", moog.lfoSpeed() >>>;
29     <<< "mod depth:", moog.lfoDepth() >>>;
30     <<< "volume:", moog.volume() >>>;
31     <<< "vibrato freq:", moog.vibratoFreq() >>>;
32     <<< "vibrato gain:", moog.vibratoGain() >>>;
34     // set freq
35     scale[Std.rand2(0,scale.cap()-1)] => int winner;
36     57 + Std.rand2(0,2)*12 + winner => Std.mtof => moog.freq;
37     // go
38     .8 => moog.noteOn;
40     // advance time
41     .5::second => now;