Getting a reference to a "zombie" synth by its ID

Hi guys, sorry for lots of question I’m asking…

I’m facing with a problem I have on my setup: sometimes, even if all my synths have the auto-deallocation system (via doneAction:2 on their EnvGen), I see some of them piling up in the nodeTree graph without being deallocated as expected (if my system stays on for, say, 14 hours, I see the s.numSynths growing and growing).

The strange thing is that all these “zombie” synths are silent because (i think) they have succesfully completed their ADSR release phase. So I’m asking why they are still there? Why they have not been deallocated?

I’m thinking about adding also a DetectSilence UGen inside their SynthDef but I would prefer to understand the cause of that.

So my question is: is there a way to get back a reference to a previously instantiated synth simply by using its ID (the one I see in the graphical representation of the nodeTree)?

I think this way I could examine the particular synth status and maybe better understand what it is doing.

Thank you in advance
na

There is Synth.basicNew which creates a client side Synth object without creating a new node on the server. If you provide the right nodeID, all messages (like .free or .release or .set) will be sent to the right node. I’m not really sure about how necessary it is to provide the right SynthDef name as well though…

Anyway, in this topic I also posted some code that gets a reference (a client side Node object) for every active node on the server. Maybe it could be useful to you!

1 Like

Thank you @elgiano,
I’ve tested it and it works exactly the way you described.
Yes indeed it is necessary to supply also the SynthDef name as a parameter.

Thank you also for the interesting example to get reference to all the synth remained on the server after the interpreter crash.
na

1 Like

Actually I have checked now, and it looks like defName is used only by Synth constructors and the .seti() method. So, you can use .set, .release and .free on Synths you got through Synth.basicNew, without knowing the actual defName (you can just send an empty symbol, e.g.: Synth.basicNew('',1156)).

Anyway, you can get SynthDef names from the osc reply to '/g_queryTree', I’m also doing it in that code :slight_smile: . Which, by the way, is adapted from something like Server.plotTreeView or Server.queryAllNodes :wink: