1 //----------------------------|
2 // on-the-fly synchronization
3 // adapted from Perry's ChucK Drummin' + Ge's sine poops
5 // authors: Perry Cook (prc@cs.princeton.edu)
6 // Ge Wang (gewang@cs.princeton.edu)
7 // --------------------|
8 // add one by one into VM (in pretty much any order):
10 // terminal-1%> chuck --loop
12 // terminal-2%> chuck + otf_01.ck
14 // terminal-2%> chuck + otf_02.ck
16 //--------------------------------------|
18 // synchronize to period
22 sinosc s => JCRev r => dac;
26 // scale (in semitones)
27 [ 0, 2, 4, 7, 9 ] @=> int scale[];
33 scale[ math.rand2(0,4) ] => float freq;
35 std.mtof( 69 + (std.rand2(0,3)*12 + freq) ) => s.freq;
36 // reset phase for extra bandwidth
40 if( std.randf() > -.5 ) .25::T => now;