Delay fii => HPF hpf => Delay foo => Delay rev => Gain PDG => Gain signal => JCRev jc => Echo ee => dac; foo => DelayA delayline => Gain g0 => fii; // fill with white noise Impulse i => delayline; //4000::samp => now; //n =< delayline; // disconnect // define transfer function of atan fun float AtanDrive(UGen input, UGen output) { Step result => output => DelayA FB => fii; 1 => FB.gain; // 0::samp => FB.max => FB.delay; input.last() => result.next; while (samp => now); } // define transfer function of f(x) = x- x^3 fun float OverDrive(UGen input, UGen output) { Step result => output => Delay FB => fii; 10 => FB.gain; 10000::samp => FB.max => FB.delay; if (input.last()>= 1.0){ do {2.0/3.0 => result.next; } while (samp => now); } else if (input.last()<= -1.0) { do {-2.0/3.0 => result.next; } while (samp => now); } else {do { Step tri; -input.last() => tri.next; input.last() => tri.next; input.last() => tri.next; 3 => tri.op; input.last() => result.next; tri.last() => result.next; // output.last() => result.next; } while (samp => now);} } // call the distortion transfer func // spork ~ AtanDrive(signal, jc); // spork ~ OverDrive(signal, jc); 0.01 => jc.mix; 1 => dac.gain; // keep the level down 20 => PDG.gain; // PDG 10::ms => ee.delay; // echo effct 0.2 => ee.mix; 0::samp => fii.max => fii.delay; 0::samp => foo.max => foo.delay; 1 => foo.gain; 1 => fii.gain; // Delay line and LPF // foo => DelayA delayline => Gain g0 => fii; delayline => Delay xl1 => fii; delayline => Delay xl2 => fii; // set LPF and delayline // // set delay line length 44100 => int fs; // set max delay line // 1000::samp => delayline.max; // LPF 1::samp => xl1.max => xl1.delay; 2::samp => xl2.max => xl2.delay; // set LPF coefficients 0.333 => g0.gain => xl2.gain; 0.333 => xl1.gain; //0.005=>xl1.a1; //0.001=>xl1.b0; // set reverberation // rev => Gain gr => rev; 0.8 => gr.gain; 0 ::samp => rev.max => rev.delay; [0.0,130.81,146.83,164.81,174.61,196.00,220.00,246.94]@=> float notes1[]; [50.0,261.63,293.66,329.63,344.23,392.00,440.00,493.88]@=> float notes2[]; [50.0,523.25,587.33,659.26,698.46,783.99,880.00,987.77]@=> float notes3[]; // go while( true ) { play(30, .4, 0); play(60, .4,0); play(70, .4,0); play(100, .4,0); 0.2::second => now; play(30, 0.2,0); play(60, 0.2,0); play(70, 0.2,0); play(70, 0.2,2); // play(70, 0.2,0); play(60, 0.2,0); play(50, 0.2,0); play(40, 0.4,0); play(60, 0.4,0); play(70, 0.4,0); play(100, 0.4,0); 0.2::second => now; play(40, 0.2,0); play(60, 0.2,0); play(70, 0.2,0); play(70, 0.2,2); // play(70, 0.2,0); play(60, 0.2,0); play(50, 0.2,0); // 0.2::second => now; play(3, .4, 0); play(30, .4,0); play(50, .4,0); play(70, .4,0); play(200, .4,1); play(300, .2,0); play(300, .2,0); play(200, .2,0); play(100, .2,0); // 1.0::second => now; play(60, .2,0); play(50, .2,0); // play(60, .2,0); // 1.0::second => now; } fun void play( int note, float duration, int mode ) { float f0; float f1; float delta; 1 => i.next; if (note>= 100) { notes3[note/100] => f0; if ((note/100)>6){f0 =>f1;} else {notes3[note/100+1] => f1;} } else if (note>= 10) { notes2[note/10] => f0; if ((note/10)>6){notes3[1]=>f1;} else {notes2[note/10+1] => f1;} } else { notes1[note] => f0; if ((note)>6){notes2[1]=>f1;} else {notes1[note+1] => f1;} } f0/16 => hpf.freq; 0.6 => hpf.Q; Math.round(fs/f0) => float L0 ; Math.round(fs/f1) => float L1 ; L0 => float L; -((1/f0)-(1/f1))/(1.1*duration)=> delta; 1.1*duration*fs => float duration2; if (mode < 1) { L::samp => delayline.delay; 1.1*duration::second => now; } else { for( 0 => int fooo; fooo < duration2 ; fooo++ ) { // debug-print value of 'foo' //<<>>; if (L > L1) { L + delta => L;} // <<>>; L::samp => delayline.delay; samp => now; // <<>>; // duration*1.1::second => now; } if (mode==1) {0 => duration2;} for( 0 => int fooo; fooo < duration2 ; fooo++ ) { // debug-print value of 'foo' //<<>>; // if (L < L1) L - delta => L; // <<>>; L::samp => delayline.delay; samp => now; // <<>>; // duration*1.1::second => now; } } }