3 // by: Ge Wang (gewang@cs.princeton.edu)
4 // Perry R. Cook (prc@cs.princeton.edu)
8 Shakers shake => JCRev r => dac;
18 if ( std.randf() > 0.25 )
20 std.rand2( 0, 22 ) => shake.which;
21 std.rand2f( 0.0, 128.0 ) => shake.freq;
22 //chout => "instrument (see docs): ";
23 //shake.which => stdout;
27 std.rand2f( 0.8, 1.3 ) => shake.noteOn;
29 if( std.randf() > 0.8 )
31 else if( std.randf() > .85 )
33 else if( std.randf() > -0.9 )
34 { .125::second => now; }
37 1 => int i => int pick_dir;
39 4 * std.rand2( 1, 5 ) => int pick;
41 0.7 / pick => float inc;
43 for( ; i < pick; i++ )
46 std.rand2f(.2,.3) + i*inc => pluck;
47 pluck + -.2 * pick_dir => shake.noteOn;
48 // simulate pluck direction
49 !pick_dir => pick_dir;
52 // let time pass for final shake