All the help files and tutorials have the Out.ar like this:
Out.ar(out, sig * env)
where you multiply the signal by the envelope you want to apply to it. I’ve been doing that sort of fine so far, but now when using LocaIn abd LocalOut, I am having weird issues, and I’m not sure if this is a bug, or just that I don’t understand what’s happening.
Here, I have not applied env1 to anything, but it is still applied to the Synth when I play it.
(
SynthDef(\what, {
arg freq=200, gate=1, out=0, amp=0.5, neg=1e-2;
var in, env, sig, del, lo, li, env1, env2;
env1 = EnvGen.ar(Env.new([0,1,0],[0.001,0.1]), doneAction:2);
//env2 = EnvGen.ar(Env.new([0,1,1,0],[0.001,1,1]),gate, doneAction:2);
in = LocalIn.ar(2);
del = DelayN.ar(
LeakDC.ar(
in), 1, neg);
sig = LPF.ar(
Trig1.ar( //takes any signal and when 0-1, outputs "1", otherwise 0's
Amplitude.kr(del, 5, 120)
* 1.5 + del + neg - (Dust.ar(1)), 4e-3)
* 0.1+del*0.99, 1200); // LPF in and frequency
LocalOut.ar(sig);
Out.ar(out, in);
}).play;
)
Very weird to me.
My end goal was to have an envelope around the Dust.ar first, before it goes through the feedback, so that the trigger is only triggered once, like one impulse (I couldn’t find any other Ugen that just triggers one time…I’m sure I’m missing something here) but then I was going to apply env2 to the whole thing ( Out.ar(out, sig * env2)
I’d really like to use a lot of envelopes inside a synthdef for sound shaping but maybe this isn’t possible?