*** empty log message ***
[chuck-blob.git] / v2 / examples / stk / blowbotl2.ck
blob35ff9de8b5186f0a76a3dbbea55ef89051ab3b39
1 // STK BlowBotl; using classic STK controlChange
2 // (also see blowbotl.ck)
4 // patch
5 BlowBotl bottle => dac;
7 // scale
8 [0, 2, 4, 7, 8, 11] @=> int scale[];
10 // infinite time loop
11 while( true )
13     Std.rand2f( 0, 128 ) => float noisegain;
14     Std.rand2f( 0, 128 ) => float vibratofreq;
15     Std.rand2f( 0, 128 ) => float vibratogain;
16     Std.rand2f( 0, 128 ) => float volume;
18     <<< "---", "" >>>;
19     <<< "noise gain:", noisegain, "/ 128.0" >>>;
20     <<< "vibrato freq:", vibratofreq, "/ 128.0" >>>;
21     <<< "vibrato gain:", vibratogain, "/ 128.0" >>>;
22     <<< "volume:", volume, "/ 128.0" >>>;
24     // noise gain
25     bottle.controlChange( 4, noisegain );
26     // vibrato freq
27     bottle.controlChange( 11, vibratofreq );
28     // vibrato gain
29     bottle.controlChange( 1, vibratogain );
30     // volume
31     bottle.controlChange( 128, volume );
33     // set freq
34     scale[Std.rand2(0,scale.cap()-1)] + 57 => Std.mtof => bottle.freq;
35     // go
36     .8 => bottle.noteOn;
38     // advance time
39     1::second => now;