How can I know if a synth is running? NodeWatcher?


Let’s say I instantiate a synth:

a = Synth(\tone);

later in the code, I want to instantiate \tone again, but only if it has been freed in the mean time.

I could add an additional variable to keep track of whether a is playing but I feel likre it’s probably redundant with a builtin functionality. It seems like NodeWatcher could be the candidate here, but I’m note sure I understand how it works.

I tried doing:

a = Synth(\tone);

but this doesn’t seem to work:
a.isRunning and a.isPlaying both return false while the synth is playing.

The second parameter to NodeWatcher:register is assumeRunning and is false by default, it sounds like you should pass true there if you are requesting the Synth on the server before registering it with a NodeWatcher.

I had missed that second parameter. It works now.

Thank you!