*** empty log message ***
[chuck-blob.git] / v2 / examples / stk / bowed.ck
blob1c0039e3282bc88db2629ed571fdb1764c8e8a70
1 // patch
2 Bowed bow => dac;
4 // scale
5 [0, 2, 4, 7, 8, 11] @=> int scale[];
7 // infinite time loop
8 while( true )
10     // set
11     Std.rand2f( 0, 1 ) => bow.bowPressure;
12     Std.rand2f( 0, 1 ) => bow.bowPosition;
13     Std.rand2f( 0, 12 ) => bow.vibratoFreq;
14     Std.rand2f( 0, 1 ) => bow.vibratoGain;
15     Std.rand2f( 0, 1 ) => bow.volume;
17     // print
18     <<< "---", "" >>>;
19     <<< "bow pressure:", bow.bowPressure() >>>;
20     <<< "bow position:", bow.bowPosition() >>>;
21     <<< "vibrato freq:", bow.vibratoFreq() >>>;
22     <<< "vibrato gain:", bow.vibratoGain() >>>;
23     <<< "volume:", bow.volume() >>>;
25     // set freq
26     scale[Std.rand2(0,scale.cap()-1)] + 57 => Std.mtof => bow.freq;
27     // go
28     .8 => bow.noteOn;
30     // advance time
31     Std.rand2f(.8, 2)::second => now;