This class is the abstract super class of Synth and Group, which represent synth and group nodes on the server. Node objects are not made explicitly, but Synth and Group are subclasses, and inherit the methods documented below.
Nodes which you explicitly free using the methods free or release will have their group instance variable set to nil. However Nodes which are automatically freed after a certain time (for instance by an EnvGen with a doneAction of 2) will not. This keeps the implementation of the classes simple and lightweight.
To have the current state of a Node tracked you can register it with an instance of NodeWatcher, either by calling register on the Node instance or on the NodeWatcher singleton. This will enable two variables, isPlaying and isRunning, which you can use for checking purposes.
Many of the methods below have two versions: a regular one which sends its corresponding message to the server immediately, and one which returns the message in an Array so that it can be added to a bundle. It is also possible to capture the messages generated by the regular methods using Server's automated bundling capabilities. See Server and Bundled Server Messages for more details.
the list of addActions as an event.
Useful for converting addAction symbols to their corresponding integer codes.
The following getter methods also have corresponding setters, but they should be used with extreme care and only if you are sure you know what you're doing.
the Node's node ID number.
Normally you should not need to access this since instances of Node can be passed directly as UGen inputs or Synth args.
an instance of Group or RootNode corresponding to this Node's group on the server.
an instance of Server corresponding to this Node's server app.
a boolean indicating if this node is currently on the server, providing this Node has been registered with a NodeWatcher.
N.B. If this Node has not been registered this will likely be false in any case.
a boolean indicating if this node is currently on the server, providing this Node has been registered with a NodeWatcher.
N.B. If this Node has not been registered this will likely be false in any case.
See the Node Commands section in Server Command Reference for the OSC equivalents of the methods outlined below.
Stop this Node and free it from its parent group on the server. Once a Node has been freed, you cannot restart it.
(sendFlag) |
a boolean indicating whether the free message should be sent. If false an n_free message will not be sent to this Node's server, but its isPlaying and isRunning variables will be set to false. The default for sendFlag is true. |
If this Node is a Group this will free all Nodes within the Group.
Set the running state of this Node according to a boolean. False will pause the node without freeing it. The default is true.
If this Node is a Group this will set the running state of all Nodes within the Group.
Set controls in this Node to values.
Controls are defined in a SynthDef as args or instances of Control. They are specified here using symbols, strings, or indices, and are listed in pairs with values. If this Node is a Group this will set all Nodes within the Group.
Values that are arrays are sent using the OSC array type-tags ($[ and $]). These values will be assigned to subsequent controls in the manner of setn.
Set sequential ranges of controls in this Node to values.
Controls are defined in a SynthDef as args or instances of Control. They are specified here using symbols, strings, or indices, and are listed in pairs with arrays of values. If this Node is a Group this will setn all Nodes within the Group.
Set sequential ranges of controls in this Node to a single value.
Controls are defined in a SynthDef as args or instances of Control. They are specified here using symbols, strings, or indices, and are listed in groups of three along with an integer indicating the number of controls to set, and the value to set them to. If this Node is a Group this will fill all Nodes within the Group.
Map controls in this Node to read from control or audio rate Buses.
Controls are defined in a SynthDef as args or instances of Control or its subclasses. They are specified here using symbols, strings, or indices, and are listed in pairs with Bus objects. The number of sequential controls mapped corresponds to the Bus' number of channels.
If this Node is a Group this will map all Nodes within the Group.
Note that with mapMsg if you mix audio and control rate busses you will get an Array of two messages rather than a single message. Integer bus indices are assumed to refer to control buses. To map a control to an audio bus, you must use a Bus object.
Map sequential ranges of controls in this Node to read from control rate Buses.
This is similar to map above, but you specify the number of sequential Controls to map. If this Node is a Group this will mapn all Nodes within the Group.
This method causes the receiver to be freed after the specified amount of time. This is a convenience method which assumes that the synth contains an envelope generator (an EnvGen, Linen, or similar UGen) running a sustaining envelope (see Env: Sustained Envelope Creation Methods) and that this envelope's gate argument is set to a control called \gate
.
releaseTime |
The amount of time in seconds during which the node will release. If set to a value NOTE: Providing a releaseTime != nil doesn't trigger a normal release, but a different behavior called forced release. This difference is particularly important for envelopes with a multi-node release stage, i.e. whose releaseNode is not their last node. See EnvGen: Forced release. |
If the receiver is a Group, all nodes within the group will be released.
Sends an n_query message to the server, which will reply with a message containing information about this node and its place in the server's node tree.
action |
An optional Function to be called. If the node is a |
This information will be printed to the post window. (See also the queryAllNodes method of Server.) "parent" indicates the Node's enclosing group. If "prev" or "next" are equal to -1 that indicates that there are no other nodes in the enclosing group before or after this one, respectively.
Causes a synth to print out the values of the inputs and outputs of its unit generators for one control period to the post window. Causes a group to print the node IDs and names of each node in the group for one control period.
Registers the node at the NodeWatcher object.
This will enable two variables, isPlaying and isRunning, which you can use for checking purposes.
The following methods can be used to change the Node's place in the order of execution. See the Order of execution help file for more information on this important topic. See Server Command Reference for the OSC equivalents of these methods.
Move this Node to be directly after aNode. N.B. n_after, the OSC message which this method encapsulates, allows already freed nodes as targets. This is so that one may attempt a series of moves, with the last successful one taking effect. For this reason this method will fail silently if either the target or this node have already been freed. If you will need to check, you may register the relevant nodes with a NodeWatcher.
Move this Node to be directly before aNode. N.B. n_before, the OSC message which this method encapsulates, allows already freed nodes as targets. This is so that one may attempt a series of moves, with the last successful one taking effect. For this reason this method will fail silently if either the target or this node have already been freed. If you will need to check, you may register the relevant nodes with a NodeWatcher.
If aGroup is a Group then this method will move this Node to the head of that Group. If it is nil this will move this Node to the head of the default_group of this Node's Server.
If aGroup is a Group then this method will move this Node to the tail of that Group. If it is nil this will move this Node to the tail of the default_group of this Node's Server.
this Node. See the asTarget help file for more details.
server.hash bitXor: nodeID.hash
true if this Node and aNode have the same nodeID and the same Server object, otherwise returns false.
Under certain circumstances this Node and aNode might not be the same object, even though this returns true.
Evaluate function when this Node is freed.
Wait until this Node is freed. Should be used inside a Routine or similar.