*** empty log message ***
[chuck-blob.git] / v2 / examples / stk / blowbotl.ck
blobe34260a798aef420b963d93d71ecaa5558fc4f41
1 // STK BlowBotl
3 // patch
4 BlowBotl bottle => 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 ) => bottle.noiseGain;
14     Std.rand2f( 0, 12 ) => bottle.vibratoFreq;
15     Std.rand2f( 0, 1 ) => bottle.vibratoGain;
16     Std.rand2f( 0, 1 ) => bottle.volume;
18     // print
19     <<< "---", "" >>>;
20     <<< "noise gain:", bottle.noiseGain() >>>;
21     <<< "vibrato freq:", bottle.vibratoFreq() >>>;
22     <<< "vibrato gain:", bottle.vibratoGain() >>>;
23     <<< "volume:", bottle.volume() >>>;
25     // set freq
26     scale[Std.rand2(0,scale.cap()-1)] + 57 => Std.mtof => bottle.freq;
27     // go
28     .8 => bottle.noteOn;
30     // advance time
31     1::second => now;