[LAU] circular ugen connections in supercollider

andy baxter andy at earthsong.free-online.co.uk
Sun Dec 21 13:50:55 EST 2008


Does anyone know how to make circular ugen connections in supercollider?

I.e. I have two chains of UGens (simple string models), which  each take 
two inputs, an impulse and (roughly) a frequency. I want a fraction of 
the output of the first to go into the impulse of the second, and the 
same the other way round, so they both affect each other. Then the idea 
is to apply an extra impulse to one 'string' and see if the other one 
resonates with it.

I can do it with the two arranged in a chain, which is nearly what I 
want, but I really want a loop so I can choose to apply the impulse to 
either string. My code so far looks like this:

(
{
var imp=EnvGen.ar(Env.triangle(0.01,1));
var sprGen,s1,s2;
sprGen={arg impulse,konst;
    var harmPower=1;
    var nh=20;
    var spr;
    spr=Array.fill(nh,{ arg ind; var hAmp;
        ind.postln;
        hAmp=1/((ind+1)**harmPower);
        hAmp.postln;
        hAmp*Spring.ar(impulse,konst*(ind+1),0.0001);
        });
    Mix.new(spr);
    };
s1=sprGen.value(imp,50);
s2=sprGen.value(s1/10,150);

Mix.new([s1,s2]);
}.play;
);


Thanks for any help with this - hope it's not too much of an esoteric 
question.

andy



More information about the Linux-audio-user mailing list