I'm trying a use a non-returning envelope (i.e. the segments in it do not return to 0). I'm finding that the envelope env
cannot be triggered more than once in the following code:
(
SynthDef(\stupidSynth,
{
|t_trig|
var env, envShape, audio, env2;
envShape = Env.new([0, 1], [0.5], \sine);
env = EnvGen.kr(envShape, t_trig);
env2 = EnvGen.kr(Env.perc, t_trig);
audio = SinOsc.ar(400 + (env * 100)) * env2 * 0.1;
Out.ar(0, audio);
}
).add;
)
(
p = Pmono(*[
\stupidSynth,
\t_trig, 1
]
).play;
)
What I was hoping for was that whenever the synth is retriggered, the pitch would get higher and higher. What actually happens is that the first note plays the pitch envelope, and each subsequent note is just at the final (i.e. high) frequency. env
is clearly not being retriggered.
I'm not sure why this would be. Envelopes don't have to have returned to 0 before they can be retriggered - it's perfectly possible to retrigger an envelope before it's finished. There's something about my envelope that isn't working.
I'm basically looking for something with the behaviour of Line
, but also able to be retriggered and have a customisable curve.
Is what I'm trying to do possible?