I’m trying to add a “CmdPeriod” action that will recreate the groups I need and start a Ndef
acting as a mixer. And I get a duplicated nodeID error between my Ndef
and the first created group.
I made the following mcve (where the the mixer is a bare sin wave for the sake of the test):
// initial definition
(
// Ndef(\sound).prime({ SinOsc.ar([600, 635], 0, SinOsc.kr(2).max(0) * 0.2) });
// ~grpMic=~grpMic??{Group.basicNew(s,Ndef(\sound).nodeID+1)};
~grpMic=~grpMic??{Group.basicNew(s)};
~grpMix=~grpMix??{Group.basicNew(s)};
~makeDefaultNodes={ |server|
"Pushing groups to the server".postln;
server.sendBundle(nil, ~grpMic.newMsg(nil,\addToHead));
server.sendBundle(nil, ~grpMix.newMsg(~grpMic,\addAfter));
// s.sync;
"Pushing the Mixer to the server".postln;
Ndef(\sound, { SinOsc.ar([600, 635], 0, SinOsc.kr(2).max(0) * 0.2) });
Ndef(\sound).play(0,2,~grpMix);
}
)
\\ start server
(
s.waitForBoot({
ServerTree.removeAll;
s.sync;
ServerTree.add(~makeDefaultNodes,s);
// Server.freeAll; // stops everything and triggers the ServerTree actions
CmdPeriod.run;
});
)
At the CmdPeriod action I’ve got the following error:
FAILURE IN SERVER /s_new duplicate node ID
because both the Ndef(\sound)
and ~grpMic
are receiving the ID “1000”.
I couldn’t find any solution to achieve this without this duplicate error.
Any idea ?
Rem: this ~grpMix=Group.basicNew(s); server.sendBundle(nil, ~grpMic.newMsg(nil,\addToHead));
approach come from this post.