In chapter 4, we saw that a synth can be manually released by supplying the node
object returned by the synth
function as the first argument to release
. But what if we forgot to manually save the node
in a variable? Fortunately, it’s also possible to control nodes manually by providing their ID number in place of the node object. To find out the ID of a node running on the server, we can use the following code:
(server-query-all-nodes)
This function doesn’t return any results, but it causes the server to print out a list of all groups and nodes currently running, which would typically look similar to the following:
NODE TREE Group 0 1 group 1047 newsynth
This output shows that there is one group running on the server (the default group with ID 1), and in that group is one instance of the “newsynth” synth, running with ID 1047. If we wanted to release this synth, we can simply supply its ID to the release
function: (release 1047)
. This also works with other functions for controlling synths on the server, such as ctrl
or free
.
Additionally, these functions will work with group IDs as well, in case you want to control all synths in a group simultaneously. So for example, to stop all synths running on the server, you can simply run the following:
(stop 1)