process a sound with a UGen inside of a loop in supercollider

82 views Asked by At

began using supercollider, read through the tutorials and practiced a bit but i can't seem to make this work. how can i process an input N times in a row ?

basically, i want build a synth to crush a sound source by running it through a distortion N times. i've tried many things, but what i want to do is basically:

// distortion function
dfunc = {
    arg inp; // input
    AnalogVintageDistortion.ar(
        inp, 1, 2.5, 20.dbamp, 10.dbamp, 200, 10
)};

// taking an input and running a 1st distortion
in = In.ar(input, 1);
dout = dfunc.value(in);

// rerunning the distorsion 10 times
10.do({
    dout = dfunc.value(dout);
});

basically, it would be a quick equivalent of doing:

dout = AnalogVintageDistorsion.ar(
  AnalogVintageDistorsion.ar(
    AnalogVintageDistorsion.ar(
      dout
    )
  )
);

i'm coming from python, where this result would be achieved by:

for i in range(10):
  dout = dfunc(dout)

thanks in advance !!

0

There are 0 answers