[chuck-users] feedback loop

Tomtom tomtom at herbesfolles.org
Fri Sep 30 17:43:53 EDT 2011

Hi chuckers,

I've just tried to reproduce something I've done some time ago with
guitar pedals : a feedback loop.

input -> mixer -> delay -[wet]-> various effects -> back to the mixer
             `--> dekay -[dry]-> output

by controling the amount of feedback on the mixer and the parameters of
the effects in the loop you can create funny things.

Now, for the ChucK part (not exactly the same, but quite similar) :


class MyDelay extends Delay
        1::second => max;

// feedback loop
MyDelay d => JCRev r => Gain g => d;
d => dac;

fun void note()
        SawOsc osc => Envelope e => d;
        250 => osc.freq;
        1 => e.value;
        200::ms => e.duration => now;

0.8 => g.gain;
0.2 => r.mix;
200::ms => d.delay;

10::second => now;


with these parameters I get a positive feedback: sound is getting louder
and louder, clipping and then silence. Using d.last(), I see the samples
computed get outside the range [-1;+1] (thus the clipping) and then
divert from 0 exponentially.

To avoid this, I would like to truncate the sample values so they stay
in the interval [-1;+1] : 

if s > 1 then s = 1, if s < -1 s = -1

I tried to use Dyno as a limiter, but it seems to do something more
clever than that.

That's all folks !


More information about the chuck-users mailing list