3 // by: Ge Wang (gewang@cs.princeton.edu)
4 // Perry R. Cook (prc@cs.princeton.edu)
8 ModalBar modey => JCRev r => dac;
16 [ 0, 2, 4, 7, 9, 11 ] @=> int scale[];
23 ( which + 1 ) % 9 => which;
24 which => modey.preset;
27 scale[Std.rand2(0,scale.cap()-1)] => int freq;
28 Math.mtof( 33 + (Std.rand2(0,3)*12) + freq ) => modey.freq;
31 Std.rand2f( 0.4, 0.8 ) => float v;
33 <<< "playing:", which, "freq:", Std.ftom(modey.freq()) $ int, "vel:", v >>>;
38 Std.rand2f( 0.2, 0.8 ) => float p => modey.strikePosition;
42 <<< " strike position:", p >>>;