Hello,
In a SynthDef, I would like to be able to trigger a portamento without re-triggering the amplitude envelope of the sound. To change the pitch envelope height (envPitch in my example), I must first send a gate = 0, then a gate = 1 at the same time as the pitch change:
(
SynthDef(\pitch, {
var env, envPitch, sig;
env = EnvGen.ar(Env.adsr(0.01, 0.3, 0.3, 1), \gate.kr(1), doneAction:2);
envPitch = EnvGen.ar(Env([\pitch1.kr, \pitch2.kr], [0.5]), \gatePitch.kr(0));
sig = SinOsc.ar(envPitch)*env*0.3;
Out.ar(0, Pan2.ar(sig));
}).add;
)
~s = Synth(\pitch, [\pitch1, 440, \pitch2, 220, \gate, 1, \gatePitch, 1]);
~s.set(\gatePitch, 0);
~s.set(\gatePitch, 1, \pitch2, 300);
~s.set(\gatePitch, 0);
~s.set(\gatePitch, 1, \pitch2, 110);
~s.set(\gate, 0);
How to automate this in the SynthDef? I can not do it.