// this patch creates three FM synthesis "voices", each // similar to the one in Drone-2.ck; each is then controlled // over time in a separately sporked control() function // output patch JCRev r => dac; // gain .05 => r.gain; // reverb mix .05 => r.mix; // # of voices 3 => int N; // sets of UGen's SinOsc m[N]; TriOsc s[N]; LPF f[N]; HPF g[N]; // connect for( int i; i < m.cap(); i++ ) { m[i] => s[i] => f[i] => g[i] => r; 2 => s[i].sync; 300 => m[i].freq; 200 => m[i].gain; } // carrier freq 73 => Std.mtof => s[0].freq; .01 => Std.mtof => s[1].freq; 53 => Std.mtof => s[2].freq; // spork control spork ~ control( s[0], f[0], g[0], 5::ms, .6009 ); spork ~ control( s[1], f[1], g[1], 5::ms, .6005 ); spork ~ control( s[2], f[2], g[2], 5::ms, .6 ); // go while( true ) 1::second => now; // control shred fun void control( Osc s, LPF f, HPF g, dur T, float freq ) { // time loop while( true ) { // set low pass cutoff //s.freq()*1.1 + s.freq() * Math.sin(now/second*freq) => f.freq; // funky junk Math.tan(now/second*freq) => float val; (-val * val + 2 * val * -val - val * val * val) / -val => float tmp; if ( tmp <= -1 || tmp >= 1 ) { 1 / tmp => tmp; } s.freq()*1.1 + s.freq() * tmp => f.freq; // set high pass cutoff f.freq() / 1.1 => g.freq; // set resonances 2 => f.Q; 4 => g.Q; // time step T => now; } }