/* Trancy Ambient Effect version 0.1 (testing) for ChucK programming language Copyright 2008 Kijjasak Triyanond (kijjaz@yahoo.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // PARAMETER 2 => int N; // number of delay lines to create 2000.0 => float MaxDelayMS; DelayA d[N]; // create N numbers of all-pass delay lines adc => SinOsc od => d[0]; // connect adc to the first delay line 1 => od.sync; // and use sine overdrive too. // initialize each delay for(int i; i < N; i++) { MaxDelayMS::ms => d[i].max; } // connect each delay line to all the ones that has higher index for(1 => int i; i < N; i++) for(0 => int j; j < i; j++) { d[j] => d[i]; } d[N-1] => Dyno limiter => LPF masterF => dac; // connect last delay line to limiter to dac; // set limiter limiter.limit(); .8 => limiter.thresh; 100000 => limiter.ratio; 0::ms => limiter.attackTime; 50::ms => limiter.releaseTime; // set master low-pass filter masterF.set(13000, 1); 1.0/N => d[N-1].gain; // scale output; // randomize delay time forever while(true) { Std.rand2f(0, MaxDelayMS)::ms => d[Std.rand2(0, N-1)].delay; 100::ms => now; }