I am not normally stumped by things like this, but this one, I’m running out of ideas.
(
{ |e1 = 0.05, e2 = 0.01, mp = 0.5, time = 0.2|
var eg = EnvGen.ar(Env(
[0.05, 0.007, 0.05],
[0.5, 0.5],
\exp
), timeScale: time);
var initTrig = Impulse.ar(0);
var trig = TDuty.ar(eg, 0, 1).poll(initTrig);
var dcy = Latch.ar(0.8 * eg, trig).poll(initTrig);
Decay.ar(trig, dcy)
}.plot(0.2);
)
UGen(TDuty): 1
UGen(Latch): 0.0399836
Expected behavior: Decay’s response to the first trigger should be commensurate with the others: 0.8 * the envelope value at the moment of being triggered.
Actual behavior: The response to the first trigger takes decay = 0. Then all the others work as expected.
I think it must be a bug. But I checked several places related to UGen initialization, and I just don’t see it. (I suppose it must be Decay. At first I thought maybe Latch was outputting 0 at the beginning, instead of the first envelope value. Now I see that it’s getting a slightly late envelope value, which is weird, but 0.0399 * 0.8 is not 0, and from the plot, clearly the initial decay time is 0. So the datum is there but Decay is not acting upon it correctly… but Decay.ar(trig, dcy + 0.025)
does decay at the start.)
It’s been awhile since I found bugs during normal SC usage… two in one day, today (other one already logged)
hjh