Hi all,
I was under the impression that if you have a Group filled with paused Synths, you can call run(true)
on the Group, and as a result all of the contained Synths will receive this message and start running, similar to calling freeAll
and set
on a Group. But, when I try to do this, I get no response.
My goal here is basically to save processing power. I’ve got a bank of Synths, and I’d like to get them all to become unpaused at the same time, preferably without having to talk to them individually. I’m aware I can store these Synths in a language-side array and iterate, but I’d rather do this by talking to their enclosing Group. I also want to point out that, regarding run
, the Node help file says:
If this Node is a Group this will set the running state of all Nodes within the Group.
Here is a simplified example. Is this possible? Am I doing something wrong?
Eli
s.boot;
(
SynthDef(\testtone, {
arg gate=1;
var sig;
sig = SinOsc.ar(200, mul: 0.1!2);
sig = sig * EnvGen.ar(Env.asr(2,1,2), gate, doneAction:1);
Out.ar(0, sig);
}).add;
)
g = Group.new;
x = Synth.newPaused(\testtone, [\gate, 0], g);
//I expected this line to produce sound, but nothing happens
g.set(\gate, 1).run(true);
g.set(\gate, 0);
//This works as expected
x.set(\gate, 1).run(true);
x.set(\gate, 0);