[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] Quickly repeated message
On Thursday, October 31, 2013 4:28:06 AM KST, Lucas Samaruga wrote:
Hi
(I don't know if to post this here, maybe something is wrong with the
synth.release message?).
There is something wrong either with my code or the server messages.
If you send /s_new with a gate > 0, and then [/n_set, id, "gate", 0]
follows within the same hardware buffer's timeframe, then both messages
will execute at the same time:
1. /s_new (gate > 0) AND /n_set (gate == 0)
2. NOW the synth starts processing, and gate has already been set to 0
So the envelope never opens -- since it never opened, it doesn't reach the
end and the synth doesn't disappear.
An easy workaround in the SynthDef is to use a timed trigger. Add it to the
gate and it will guarantee that the gate stays open for at least a full
control cycle.
SynthDef(\test, { |gate = 1, amp = 0.1, out|
var sig = SinOsc.ar(ExpRand(400, 800), 0, amp),
trigWorkaround = Trig1.ar(Impulse.ar(0), ControlDur.ir + 0.001),
eg = EnvGen.ar(Env.asr(0.005, 1, 0.005), gate + trigWorkaround,
doneAction: 2);
Out.ar(out, (sig * eg) ! 2);
}).add;
hjh
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/