Generally a proxy is a placeholder for something. A node proxy is a placeholder for something playing on a server and writes to a limited number of busses (usually a synth, but also an event stream that makes synths). NodeProxy objects can be replaced and recombined while they play. Also they can be used to build a larger structure which is used and modified later on. Overview: JITLib.
NodeProxy is used internally in ProxySpace and it is a superclass of Ndef, allowing to easily access and combine a large number of placeholders.
Graphical editor for a node proxy: NdefGui.
Return a new instance of NodeProxy.
server |
The server on which to run and where the bus is allocated (default: |
rate |
If given, proxy is initialized to this rate |
numChannels |
If given, proxy is initialized to this number of channels |
inputs |
If given, proxy is initialized with the given inputs as objects on subsequent slots. |
Create a new audio rate instance on the given server.
Create a new control rate instance on the given server.
Create an instance with a given Bus.
Default number of channels when initializing in audio rate and no specific number is given (default: 2).
Default number of channels when initializing in control rate and no specific number is given (default: 1).
The overlap time between successive source replacements which all instances have by default. Each instance has its own value which can be set via fadeTime_
.
Play from a bus index with a number of channels to another index with a number of channels, within a Group (i.e. a target group or server).
out |
bus index |
numChannels |
number of channels to output. If BusPlug is neutral or reshaping is elastic, initialize it to this number. If this is more than the available channels, wrap around. If this is not given, and reshaping is elastic, it will automatically expand. |
group | |
multi |
keep old playback links and add new one |
vol |
overall volume at which to monitor |
fadeTime |
fade in / fade out time |
addAction |
Where in the node tree to play the monitor synths |
Play back on non-contiguous channels. See: Monitor and playN
outs |
array of destination channels (or single value) |
amps |
array of amplitudes for each channel (or single value) |
ins |
array of source channel offsets within the bus (or single value) |
vol |
Overall volume (multiplied by amps) |
fadeTime |
array of fadeTimes (or single value) for fade in / fade out |
group | |
addAction |
Where in the node tree to play the monitor synths |
stop to play out public channels.
fadeTime |
decay time for this action |
reset |
if set to true, reset all monitor state. Otherwise, the previous play arguments are kept. |
releases the synths and stops playback.
fadeTime |
cross fade time for this action. |
reset |
if set to true, reset all monitor state. Otherwise, the previous play arguments are kept. |
Return a link to numChannels of my output. If uninitialized, creates a matching bus. Normally, ar defaults to stereo, kr to mono. This can be set in the classvars: *defaultNumAudio, *defaultNumControl
For consistency, it always returns an array of signals when no numChannels are given. To make it a single ugen output, use numChannels = 1
. See also: InBus.
numChannels |
Number of channels returned. If the receiver is neutral or reshaping is elastic, initialize it to this number. If this is more than the available channels, use the clip behaviour (below). If set to |
offset |
Channel offset when reading a bus that has more channels than numChannels, cross fading between adjacent channels. |
clip |
If set to 'wrap', exceeding channels will wrap around, if set to 'clip', repeat the last one. |
Usage: proxyA <-- proxyB. Set proxyA source to proxyB and play proxyA. If proxyB was playing, fade it out. This is convenient in the following situation:
Chaining. Usage: proxyA <<> proxyB <<> proxyC <<> ... . Map proxyC source to proxyB \in
argument, and proxyB to proxyA's in argument.
Inverse of the above. Usage: proxyA <>> proxyB <>> proxyC <>> ... .
NodeProxy keeps a number of slots which can be sources and are mixed on the same bus.. The default source is the slot 0. All objects can be exchanged while running, and also before and after. Normally, the source is active immediately. If sources are to be exchanged "quietly", set the node proxy to sleep (awake = false), or use the message prime().
See the list under section Supported sources
Play a new synth through proxy and release/remove any old ones.
obj |
can be one of the supported inputs (see Supported sources) NOTE: When reshaping is set, e.g. to \elastic, setting the source can change the number of channels of the proxy. This means that its bus changes, and that child proxies, which read signals from it, may also change. See the example in Routing. |
Signals can be routed between any number of node proxies.
See also: BusPlug: -ar, BusPlug: -value, Reshaping.
Here is a simple example, using Ndef (NodeProxy works similarly):
Ndef.kr(\maus)
will return an Array. Subsequently, e.g. by a Pan2
UGen, you may get the message:
WARNING: Synth output should be a flat array.
If you intend the output to be really mono, make it explicit by writing: Ndef.kr(\maus, 1)
With elastic reshaping, you can use the parent to expand the child, if you omit the number of channels in the routing:
Three parameters are automatically specified if they don't exist in a given UGen function. You can override their use: [\out, \gate, \fadeTime]
If a UGen function that is passed to the proxy has its own envelope, and if this envelope can free the synth, the node proxy uses this envelope instead of making its own. If you provide a fadeTime
argument, the proxy's fadeTime will be used.
copies the hidden internal state to make the new proxy independent of the old, but will keep the reference to the source object. The rendered SynthDef is cached, which makes this method more efficient than simply assigning the same function to a new proxy. By design, the monitor is copied, but is not running (use play to start it in the same configuration).
Copy the internal settings of one proxy into another. Old state is cleared.
proxy |
The proxy whose internal state is copied. |
Determines how to behave when a new source is added. Current options:
nil | Once initialized, keep the same bus - this is the default |
\elastic | On a change, shrink and grow according to need, replace bus. The monitor and child proxies are adjusted. |
\expanding | On a change, only grow according to need, replace bus. The monitor and child proxies are adjusted. |
Adjust the proxy to a given rate / numChannels. If there are any child proxies that have elastic -reshaping, they are adjusted accordingly.
Set source without starting the synth. To start it, -send can be used later. Running synths are released and proxy is initialized if still neutral.
Add a new source to the present ones
Remove the object at index i and its synths, if they exist. If no index is supplied, remove them all.
Remove the last object and its synths, if they exist.
Set the source by index. Objects can be inserted at any index, only the order of indices is relevant. Internally, NodeProxy uses an Order to access the sources.
index |
where the object should be placed in the internal order. if |
obj |
A valid source (see Supported sources). |
channelOffset |
using a multichannel setup it can be useful to set this, when the objects numChannels is smaller than the proxy |
extraArgs |
Arguments that can be sent with the object directly (not cached) |
now |
if set to false, only prepare the source and do not start the object (see -prime) |
Pause all objects and set proxy to paused
If paused, start all objects
Rebuild all SynthDefs from sources.
Arrange the order of groups from this to the last. This can be important when external input is filtered in order to minimize latency. Note that if a -parentGroup was provided, the nodes must be in the same parentGroup.
Release all running synths and the group. If patterns are playing, stop them.
fadeTime |
decay time for this action |
freeGroup |
a boolean |
release running synths. If patterns are playing, stop them.
fadeTime |
decay time for this action |
reset everything to nil, neutralizes rate/numChannels
fadeTime |
if a fadeTime is given, first fade out, then clear. |
Calls a function after the fadeTime and server latency have passed. If the proxy specifies a quant
value, the function is evaluated fadeTime + latency
seconds after the next timepoint on the quant grid; otherwise, the fade delay begins immediately.
func |
a function to be called at the appropriate time |
Returns an array of all sources
Returns the first source.
The node proxy's server (a Server).
The node proxy's private bus (a Bus). Because it has a private bus, it is not audible directly - monitoring it by (.play or playN) routes it to the hardware output channels.
The bus rate (default: nil) The rate and number of channels is determined either when the instance is created (.control/.audio) or by lazy initialisation from the first source (see the_lazy_proxy)
The bus numChannels (default: nil)
true if the proxy has no initialized bus.
The node proxy's group (a Group). This is maintained by the proxy and serves as a context in which all synths are placed.
Access the parentGroup (default: nil), which can be set to run the proxy's group in another group. This group has to be maintained (kept playing etc.) externally.
A clock, which can be set to account for different timing schemes, such as beat accurate replacement of sources.
A quant value, to specify quantizes replacement of sources. Compatible with the general use of quant in SuperCollider.
Synchronize the proxies by resending and adjusting to quant.
Access the Monitor object, which plays back the output of the proxy's private bus.
Returns true if the object has been initialized on the server, e.g. a synthDef has been stored.
Returns true if the processes are paused.
If set to false (default: true), a change of the source does not start a new synth immediately. This is useful when synths are triggered by -spawn, and a change of sound should not duplicate sends.
set the crossfade time. See: jitlib_fading .
NodeProxy behaves like its NodeMap and very similar to a Synth.
... args |
An array of pairs: key, value, key, value, ... The unique key (a Symbol) specifies the control name to be set. For value anything can be specified that responds to "asControlInput", in particular:
|
Set part of an arrayed control, analog to Synth: -seti.
... args |
A sequence of name, index, value triplets.
|
Remove specified settings and unmap or unset the synths.
set/map with a crossfade into the new setting. The crossfade time is the NodeProxy -fadeTime.
set the lag values of these args (identical to -setRates). To remove these settings, use: lag(\key1, nil, key2, nil, ...)
set the default rate (\tr, \ir, numerical) for synthDef arg. A rate of nil removes setting.
Returns the ControlName objects of all slots, except the names of this list (default: [\out, \i_out, \gate, \fadeTime]
, which are used internally). When the node proxy received a set
for a given key, the defaultValue
of the corresponding ControlName
contains the object that was passed, which might be any object whatsoever.
Returns the keys (symbols) of all control names objects of all slots, except the names of this list. (default: none).
except |
list of names |
noInternalKeys |
If noInternalKeys is true (default: true), it ignores the keys |
Get all key value pairs from both NodeMap (the settings) and default arguments.
Get all key value pairs from default arguments.
Search the source objects for a given control name symbol and return the ControlName.
Get the specs array from SynthDef metadata. Note that, for a NodeProxy with multiple sources, result will be a dictionary containing specs of ALL source SynthDefs.
Normally, processes (usually synths) are started when their respective source is added to the proxy. The processes can also be restarted, however, or the proxy can be used while asleep and the processes can then be started explicitly.
Send a new synth without releasing the old one. If the source is a stream or a pattern, it starts a new one.
extraArgs |
Arguments used to set the synth. The argument list is applied to the synth only. Arguments specified here override settings in the node map, but leave them untouched. |
index |
What slot to send a new synth with. If nil, uses all. (default: nil) |
freeLast |
if to free the last synth at that index or not (default: true) |
Send all synths, or restart all objects.
extraArgs |
Arguments used to set the synth. the argument list is applied to the synth only. |
freeLast |
if to free the last synth at that index or not (default: true) |
Like send, just iterating separately over the objects.
Until the proxy is not used by any output ( either .play or .ar/.kr ) it is not running on the server. you can wake it up to force it playing. Normally this is not needed.
stores the proxy as executable code. see also jitlib_asCompileString for more examples.
For more, see ProxySpace
Definitions for other sources can be added - see: NodeProxy roles