How to use the NodeWatcher

How should I use the NodeWatcher correctly? Say, I have a synth created with ~foo = Synth(\foo) and also registered it within the watcher with NodeWatcher.register(~foo). Now asking ~foo.isPlaying or ~foo.isRunning still return false. Can any one help?

try this:
~foo = Synth.newPaused(\default)

If you register the NodeWatcher after creating the synth, it might be that the NodeWatcher doesn’t get the reply from the server which it uses to set isPlaying to true. There are couple of options:

  • Using assumePlaying set to true: NodeWatcher.register(~foo, assumePlaying: true);
  • Registering at the same time as synth creation: ~foo = Synth(\foo); NodeWatcher.register(~foo) or shorter ~foo = Synth(\foo).register