// ===== sine map ===== // parameters for INF // change r from 0.0 to 4.0 (noise) // increase with i, decrease with k 3.5 => float r; // change inital x from -pi/2.0 to pi/2.0 // increase with l, decrease with j pi/4.0 => float x; // ===== the patch ===== X.in => Gain g => Delay d => LPF l => X.out; 4095::samp => d.delay; 0.75 => g.gain; float l_target, l_inc; 880 => l_target; float Q_target, Q_inc; spork ~ interpFreq( ); spork ~ interpQ( ); 0 => int n; while( true ) { // compute next value of x Math.sin(r*x) => x; Math.fabs(x)*880+200 => l_target; 12*Math.fabs(Math.sin(2*pi*n/180)) + 1 => Q_target; <<< "LPF freq: ", l.freq( ), " Q: ", l.Q( ) >>>; n++; Math.fabs(x*2.5)::second => now; } // interpolate filter cutoff freq fun void interpFreq( ) { .8 => float slew; while (1) { (l_target - l_inc) * slew + l_inc => l_inc => l.freq; if( l.freq( ) <= 0.0 ) 1.0 => l.freq; 0.1 :: second => now; } } // interpolate filter cutoff freq fun void interpQ( ) { .8 => float slew; while (1) { (Q_target - Q_inc) * slew + Q_inc => Q_inc => l.Q; if( l.Q( ) <= 0.0 ) 1.0 => l.Q; 0.1 :: second => now; } }