Right now, if an instrument ends before it is gated off (because it has a fixed envelope generator, for example), the /n_set commands fails because the synth node has already been freed. To avoid that, track nodes in the server by listening to /n_go and /n_end OSC messages that the server sends, to know with certainty if a node exists or not at a given time.
This is a code example for Supercollider that shows how the OSC messages look like:
(OSCresponderNode(s.addr,'/n_end',{argtime,responder,msg;[time,responder,msg].postln;}).add;)n=s.nextNodeID;s.sendMsg("/s_new","sin",n,0,0,"freq",850);s.sendMsg("/n_set",n,"freq",600);s.sendMsg("/n_free",n);
Right now, if an instrument ends before it is gated off (because it has a fixed envelope generator, for example), the
/n_setcommands fails because the synth node has already been freed. To avoid that, track nodes in the server by listening to/n_goand/n_endOSC messages that the server sends, to know with certainty if a node exists or not at a given time.This is a code example for Supercollider that shows how the OSC messages look like: