3 // based off of mand-o-matic ( master plan )
5 // by: Ge Wang (gewang@cs.princeton.edu)
6 // Perry R. Cook (prc@cs.princeton.edu)
10 ModalBar modey => JCRev r => Echo a => Echo b => Echo c => dac;
16 // set max delay for echo
17 1000::ms => a.max => b.max => c.max;
19 750::ms => a.delay => b.delay => c.delay;
20 // set the initial effect mix
21 0.0 => a.mix => b.mix => c.mix;
23 // shred to modulate the mix
24 fun void echo_shred( ) {
25 0.0 => float decider => float mix => float old => float inc;
30 std.rand2f(0.0,1.0) => decider;
31 if( decider < .35 ) 0.0 => mix;
32 else if( decider < .55 ) .08 => mix;
33 else if( decider < .8 ) .5 => mix;
37 (mix-old)/1000.0 => inc; 1000 => int n;
41 // set the mix for a, b, c
42 old + inc => old => a.mix => b.mix => c.mix;
47 // let time pass until the next iteration
48 std.rand2(2,6)::second => now;
59 if ( std.randf() > 0.9 ) {
60 std.rand2 (0,8) => modey.preset;
63 std.rand2f( 0.2, 0.8 ) => modey.strikePosition;
65 2 * std.rand2( 0, 4 ) => int freq;
66 if( freq == 6 ) 7 => freq; if( freq == 8 ) 9 => freq;
67 110.0 * math.pow( 1.05946, (float)(std.rand2(0,3)*12)
68 +(float)freq ) => modey.freq;
70 std.rand2f( 0.2, 0.6 ) => modey.strike;
72 if( std.randf() > 0.8 )
74 else if( std.randf() > .85 )
76 else if( std.randf() > -0.9 )
77 { .125::second => now; }
80 1 => int i => int pick_dir;
82 4 * std.rand2( 1, 5 ) => int pick;
84 0.65 / (float)pick => float inc;
86 for( ; i < pick; i++ )
89 std.rand2f(.2,.3) + (float)i*inc => pluck;
90 pluck => modey.stickHardness;
91 pluck + -.2 * (float)pick_dir => modey.strike;
92 // simulate pluck direction
93 !pick_dir => pick_dir;
95 // let time pass for final pluck