Function
Static Public Summary | ||
public |
allocBlock(state: Immutable.Map, blockSize: int): Array Allocates a contigious block of numbers. |
|
public |
ampToDb(amp: *): * |
|
public |
Boot a server with options and connect |
|
public |
alternate constructor resolves options, boots and loads interpreter |
|
public |
bufferAlloc(bufferID: int, numFrames: int, numChannels: int, completionMsg: Array): Array Allocates zero filled buffer to number of channels and samples. |
|
public |
bufferAllocRead(bufferID: int, path: String, startFrame: int, numFramesToRead: int, completionMsg: Array): Array Allocate buffer space and read a sound file. |
|
public |
bufferAllocReadChannel(bufferID: int, path: String, startFrame: int, numFramesToRead: int, channels: Array<int>, completionMsg: Array): Array Allocate buffer space and read channels from a sound file. |
|
public |
bufferClose(bufferID: int): Array After using a buffer with |
|
public |
bufferFill(bufferID: int, startFrame: int, numFrames: int, value: float): Array Fill ranges of samples with a value |
|
public |
bufferFree(bufferID: int, completionMsg: Array): Array Frees buffer space allocated for this buffer. |
|
public |
Call a command to fill a buffer. |
|
public |
Get sample value(s). |
|
public |
bufferGetn(bufferID: int, startFrame: int, numFrames: int): Array Get ranges of sample value(s). |
|
public |
bufferQuery(bufferID: int): Array Get buffer info. |
|
public |
bufferRead(bufferID: int, path: String, startFrame: int, numFramesToRead: int, startFrameInBuffer: int, leaveFileOpen: int, completionMsg: Array): Array Read sound file data into an existing buffer. |
|
public |
bufferReadChannel(bufferID: int, path: String, startFrame: int, numFramesToRead: int, startFrameInBuffer: int, leaveFileOpen: int, channels: Array<int>, completionMsg: Array): Array Read sound file channel data into an existing buffer. |
|
public |
Takes a list of pairs of sample indices and values and sets the samples to those values. |
|
public |
bufferSetn(bufferID: int, startFrame: int, values: Array<float>): Array Set ranges of sample value(s). |
|
public |
bufferWrite(bufferID: int, path: String, headerFormat: String, sampleFormat: String, numFramesToWrite: int, startFrameInBuffer: int, leaveFileOpen: int, completionMsg: Array): Array Write buffer contents to a sound file. |
|
public |
bufferZero(bufferID: int, completionMsg: Array): Array Sets all samples in the buffer to zero. |
|
public |
callAndResolve(value: *, context: *, keyName: *): * If value is a function then call it, if function returns a Promise then resolve it. |
|
public |
callAndResolveAll(things: Array, parentContext: Object): Promise Call and resolve each of the items in a list |
|
public |
callAndResolveValues(object: Object, context: Object): Promise Call and resolve each of the values of an Object. |
|
public |
clearSched(): Array Clear all scheduled bundles. |
|
public |
Execute a command defined by a UGen Plug-in |
|
public |
compileSynthDef(defName: String, sourceCode: String): * Compile a SynthDef from a snippet of supercollider source code, send it to the server and stores the SynthDesc in server.state |
|
public |
controlBusFill(triples: Array): Array Fill ranges of bus value(s). |
|
public |
controlBusGet(busID: Number): Array Get control bus values |
|
public |
controlBusGetn(startBusIndex: int, numBusses: int): Array Get contiguous ranges of buses. |
|
public |
controlBusSet(pairs: Array): Array Takes a list of pairs of bus indices and values and sets the buses to those values. |
|
public |
controlBusSetn(triples: Array): Array Set ranges of bus value(s). |
|
public |
dB(spec: *): * Returns dB mapping function (DbFaderWarp) |
|
public |
dbToAmp(db: *): * |
|
public |
Delete synth definition. |
|
public |
Load synth definition. |
|
public |
defLoadDir(path: String, completionMsg: Array): Array Load a directory of synth definitions. |
|
public |
Loads a file of synth definitions from a data buffer included in the message. |
|
public |
deltaTimeTag(seconds: Number, now: Date): * deltaTimeTag(secondsFromNow, [now]) |
|
public |
dryadic(rootDryad: *, moreLayers: *[], rootContext: {}): * Create a DryadPlayer from a Dryad or hyperscript definition. |
|
public |
|
|
public |
Dump incoming OSC messages to stdout |
|
public |
Enable/disable error message posting. |
|
public |
exp(spec: *): * Returns an exponential mapping function |
|
public |
expToLin(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * |
|
public |
fader(spec: *): * Returns amp mapping function (FaderWarp) |
|
public |
freeBlock(state: Immutable.Map, addr: int, blockSize: int): Immutable.Map Return a previously allocated block back to the free list. |
|
public |
freeBlockList(state: Immutable.Map): Array Returns a list of the free blocks and their sizes. |
|
public |
freqToMidi(freq: *): * |
|
public |
group(children: *): * |
|
public |
groupDeepFree(groupID: int): Array Free all synths in this group and all its sub-groups. |
|
public |
groupDumpTree(groupID: int, dumpControlValues: int): Array Post a representation of this group's node subtree to STDOUT Posts a representation of this group's node subtree, i.e. |
|
public |
groupFreeAll(groupID: int): Array Frees all immediate children nodes in the group |
|
public |
Moves node to the head (first to be executed) of the group. |
|
public |
Create a new group. |
|
public |
groupQueryTree(groupID: int, dumpControlValues: int): Array Get a representation of this group's node subtree. Request a representation of this group's node subtree, i.e. |
|
public |
Moves node to the tail (last to be executed) of the group. |
|
public |
h(hgraph: *): * Convert hyperscript object to a tree of Dryads. |
|
public |
A simple incrementing allocator used for nodeIds. |
|
public |
initialBlockState(initialSize: int): Immutable.Map Create initial state for block allocator. |
|
public |
interpreter(children: *[], options: {}): * Boots a new supercollider interpreter making it available for all children
as |
|
public |
linToExp(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * |
|
public |
linToLin(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * |
|
public |
linear(spec: *): * Returns a linear mapping function |
|
public |
Format an object for osc-min bundle |
|
public |
makeChildContext(parentContext: *, keyName: *): * |
|
public |
makeMessage(msg: *): * Format an object for osc-min message |
|
public |
mapWithSpec(value: *, spec: *): * |
|
public |
midiToFreq(midiNote: *): * |
|
public |
Places node A in the same group as node B, to execute immediately after node B. |
|
public |
nodeBefore(moveNodeID: int, beforeNodeID: int): Array Places node A in the same group as node B, to execute immediately before node B. |
|
public |
Fill ranges of a node's control value(s). Set contiguous ranges of control indices to single values. For each range, the starting control index is given followed by the number of controls to change, followed by the value to fill. If the node is a group, then it sets the controls of every node in the group. |
|
public |
Delete/free a node |
|
public |
Map a node's controls to read from a bus. |
|
public |
nodeMapAudio(nodeID: int, pairs: Array): Array Map a node's controls to read from an audio bus. Takes a list of pairs of control names or indices and audio bus indices and causes those controls to be read continuously from a global audio bus. If the node is a group, then it maps the controls of every node in the group. If the audio bus index is -1 then any current mapping is undone. Any n_set, n_setn and n_fill command will also unmap the control. For the full audio rate signal, the argument must have its rate set to \ar. |
|
public |
nodeMapAudion(nodeID: int, triples: Array): Array Map a node's controls to read from audio buses. |
|
public |
Map a node's controls to read from buses. Takes a list of triples of control names or indices, bus indices, and number of controls to map and causes those controls to be mapped sequentially to buses. If the node is a group, then it maps the controls of every node in the group. If the control bus index is -1 then any current mapping is undone. Any n_set, n_setn and n_fill command will also unmap the control. |
|
public |
Move and order a list of nodes. |
|
public |
Get info about a node. |
|
public |
Stop/start a node from running |
|
public |
Set a node's control value(s). Takes a list of pairs of control indices and values and sets the controls to those values. If the node is a group, then it sets the controls of every node in the group. This message now supports array type tags ($[ and $]) in the control/value component of the OSC message. Arrayed control values are applied in the manner of n_setn (i.e., sequentially starting at the indexed or named control). I think this also takes [freq, 440], |
|
public |
Set ranges of a node's control value(s). Set contiguous ranges of control indices to sets of values. For each range, the starting control index is given followed by the number of controls to change, followed by the values. If the node is a group, then it sets the controls of every node in the group. |
|
public |
Trace a node. |
|
public |
End real time mode, close file. |
|
public |
Register to receive notifications from server |
|
public |
Call a function when the server sends an /n_end message One callback allowed per id and node. |
|
public |
Call a function when the server sends an /n_go message One callback allowed per id and node The id is usually a context id but could be a random guid |
|
public |
parallelGroupNew(groupID: int, addAction: int, targetID: int): Array Create a new parallel group. |
|
public |
parseMessage(msg: *): * Convert full OSC message to a simple Array |
|
public |
Play a Dryad or hyperscript document. |
|
public |
putSynthDef(context: *, defName: *, synthDesc: *) store synthDefDesc in server state. |
|
public |
Tell server to exit |
|
public |
requireInterpreter(child: *, options: {}): * Boots a supercollider interpreter if none is already available
in the context making it available for all children
as |
|
public |
requireServer(child: *, options: {}): * Boots a supercollider server if none is already available
in the context making it available for all children
as |
|
public |
reserveBlock(state: Immutable.Map, addr: int, blockSize: int): Immutable.Map Reserve a block by re-writing the free list |
|
public |
resolveOptions(configPath: String, commandLineOptions: Object): Promise load configuration files and merge options into a final dict |
|
public |
scserver(command: *, context: *): * Send OSC to the SuperCollider server (scsynth) |
|
public |
server(children: *[], options: {}): * Boots a new supercollider server making it available for all children making it available for all children
as |
|
public |
Query for server status. |
|
public |
stream(streamable: Rx.Observeable): * Spawns each item returned by an Rx.Observable stream. |
|
public |
Notify when async commands have completed. |
|
public |
Generates a function that will spawn a Synth when it is called |
|
public |
Get control value(s). |
|
public |
Get ranges of control value(s). |
|
public |
Create a new synth. |
|
public |
Auto-reassign synths' ID to a reserved value. This command is used when the client no longer needs to communicate with the synth and wants to have the freedom to reuse the ID. The server will reassign this synth to a reserved negative number. This command is purely for bookkeeping convenience of the client. No notification is sent when this occurs. |
|
public |
synthStream(streamable: *, params: {}): * Spawns each event in an Rx.Observeable stream |
|
public |
Send a command to a unit generator. |
|
public |
unmapDb(spec: *): * Returns inverse of dB mapping function (DbFaderWarp) |
|
public |
unmapExp(spec: *): * Returns inverse of exponential mapping function |
|
public |
unmapFader(spec: *): * Returns inverse of amp mapping function (FaderWarp) |
|
public |
unmapLinear(spec: *): * Returns inverse of linear mapping function |
|
public |
unmapWithSpec(value: *, spec: *): * |
|
public |
updateNodeState(server: *, nodeID: *, nodeState: *) Update values in the Server's node state registery |
|
public |
watchNodeNotifications(server: Server): Rx.Disposable Watch server OSC receive for any n_XXX messages Save info for node and call any registered callbacks. |
|
public |
whenNodeEnd(server: *, id: *, nodeID: *): * Returns a Promise that resolves when the server sends an /n_end message The id is usually a context id but could be a random guid |
|
public |
whenNodeGo(server: Server, id: String, nodeID: int): Promise Returns a Promise that resolves when the server sends an /n_go message The id is usually a context id but could be a random guid |
|
public |
withContext(parentContext: Object | undefined, requireSCSynth: Boolean, requireSClang: Boolean): * Create a context, inheriting from parentContext. |
Static Public
public allocBlock(state: Immutable.Map, blockSize: int): Array source
import {allocBlock} from 'supercolliderjs/src/server/internals/allocators.js'
Allocates a contigious block of numbers.
Params:
Name | Type | Attribute | Description |
state | Immutable.Map | ||
blockSize | int | number of numbers eg. numChannels |
public ampToDb(amp: *): * source
import {ampToDb} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
amp | * |
Return:
* |
public boot(options: Object, store: Store): Promise source
import {boot} from 'supercolliderjs/src/server/server.js'
Boot a server with options and connect
public boot(options: object): Promise source
import {boot} from 'supercolliderjs/src/lang/sclang.js'
alternate constructor resolves options, boots and loads interpreter
Params:
Name | Type | Attribute | Description |
options | object |
public bufferAlloc(bufferID: int, numFrames: int, numChannels: int, completionMsg: Array): Array source
import {bufferAlloc} from 'supercolliderjs/src/server/osc/msg.js'
Allocates zero filled buffer to number of channels and samples.
Asynchronous. Replies with /done /b_alloc bufNum
.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
numFrames | int | ||
numChannels | int | ||
completionMsg | Array | (optional) |
public bufferAllocRead(bufferID: int, path: String, startFrame: int, numFramesToRead: int, completionMsg: Array): Array source
import {bufferAllocRead} from 'supercolliderjs/src/server/osc/msg.js'
Allocate buffer space and read a sound file.
Allocates buffer to number of channels of file and number of samples requested, or fewer if sound file is smaller than requested. Reads sound file data from the given starting frame in the file. If the number of frames argument is less than or equal to zero, the entire file is read.
Asynchronous. Replies with /done /b_allocRead bufNum
.
public bufferAllocReadChannel(bufferID: int, path: String, startFrame: int, numFramesToRead: int, channels: Array<int>, completionMsg: Array): Array source
import {bufferAllocReadChannel} from 'supercolliderjs/src/server/osc/msg.js'
Allocate buffer space and read channels from a sound file.
As b_allocRead
, but reads individual channels into the allocated buffer in the order specified.
Asynchronous. Replies with /done /b_allocReadChannel bufNum
.
public bufferClose(bufferID: int): Array source
import {bufferClose} from 'supercolliderjs/src/server/osc/msg.js'
After using a buffer with DiskOut
, close the soundfile and write header information.
Asynchronous. Replies with /done /b_close bufNum
.
Params:
Name | Type | Attribute | Description |
bufferID | int |
public bufferFill(bufferID: int, startFrame: int, numFrames: int, value: float): Array source
import {bufferFill} from 'supercolliderjs/src/server/osc/msg.js'
Fill ranges of samples with a value
Set contiguous ranges of sample indices to single values. For each range, the starting sample index is given followed by the number of samples to change, followed by the value to fill. This is only meant for setting a few samples, not whole buffers or large sections.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
startFrame | int | ||
numFrames | int | ||
value | float |
public bufferFree(bufferID: int, completionMsg: Array): Array source
import {bufferFree} from 'supercolliderjs/src/server/osc/msg.js'
Frees buffer space allocated for this buffer.
Asynchronous. Replies with /done /b_free bufNum
.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
completionMsg | Array | (optional) |
public bufferGen(bufferID: int, command: String, args: Array): Array source
import {bufferGen} from 'supercolliderjs/src/server/osc/msg.js'
Call a command to fill a buffer.
Plug-ins can define commands that operate on buffers. The arguments after the command name are defined by the command. The currently defined buffer fill commands are listed below in a separate section.
Asynchronous. Replies with /done /b_gen bufNum
.
public bufferGet(bufferID: int, framesArray: Array): * source
import {bufferGet} from 'supercolliderjs/src/server/osc/msg.js'
Get sample value(s).
Replies with the corresponding /b_set
command.
Params:
Name | Type | Attribute | Description |
bufferID | int | buffer number |
|
framesArray | Array | sample indices to return |
Return:
* |
public bufferGetn(bufferID: int, startFrame: int, numFrames: int): Array source
import {bufferGetn} from 'supercolliderjs/src/server/osc/msg.js'
Get ranges of sample value(s).
Get contiguous ranges of samples. Replies with the corresponding b_setn
command. This is only meant for getting a few samples, not whole buffers or large sections.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
startFrame | int | starting sample index |
|
numFrames | int | number of sequential samples to get (M) |
public bufferQuery(bufferID: int): Array source
import {bufferQuery} from 'supercolliderjs/src/server/osc/msg.js'
Get buffer info.
Responds to the sender with a /b_info
message with:
multiple:
param {int} bufferID
param {int} - number of frames
param {int} - number of channels
param {float} sample rate
Params:
Name | Type | Attribute | Description |
bufferID | int |
public bufferRead(bufferID: int, path: String, startFrame: int, numFramesToRead: int, startFrameInBuffer: int, leaveFileOpen: int, completionMsg: Array): Array source
import {bufferRead} from 'supercolliderjs/src/server/osc/msg.js'
Read sound file data into an existing buffer.
Reads sound file data from the given starting frame in the file and writes it to the given starting frame in the buffer. If number of frames is less than zero, the entire file is read.
If reading a file to be used by DiskIn
ugen then you will want to set "leave file open" to one, otherwise set it to zero.
Asynchronous. Replies with /done /b_read bufNum
.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
path | String | path name of a sound file. |
|
startFrame | int | starting frame in file (optional. default = 0) |
|
numFramesToRead | int | number of frames to read (optional. default = -1, see below) |
|
startFrameInBuffer | int | starting frame in buffer (optional. default = 0) |
|
leaveFileOpen | int | leave file open (optional. default = 0) |
|
completionMsg | Array | (optional) |
public bufferReadChannel(bufferID: int, path: String, startFrame: int, numFramesToRead: int, startFrameInBuffer: int, leaveFileOpen: int, channels: Array<int>, completionMsg: Array): Array source
import {bufferReadChannel} from 'supercolliderjs/src/server/osc/msg.js'
Read sound file channel data into an existing buffer.
As b_read
, but reads individual channels in the order specified. The number of channels requested must match the number of channels in the buffer.
Asynchronous. Replies with /done /b_readChannel bufNum
.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
path | String | of a sound file |
|
startFrame | int | starting frame in file |
|
numFramesToRead | int | number of frames to read |
|
startFrameInBuffer | int | starting frame in buffer |
|
leaveFileOpen | int | leave file open |
|
channels | Array<int> | source file channel indexes |
|
completionMsg | Array |
public bufferSet(bufferID: int, sets: Array): Array source
import {bufferSet} from 'supercolliderjs/src/server/osc/msg.js'
Takes a list of pairs of sample indices and values and sets the samples to those values.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
sets | Array | [[frame, value], ...] |
public bufferSetn(bufferID: int, startFrame: int, values: Array<float>): Array source
import {bufferSetn} from 'supercolliderjs/src/server/osc/msg.js'
Set ranges of sample value(s).
Set contiguous ranges of sample indices to sets of values. For each range, the starting sample index is given followed by the number of samples to change, followed by the values.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
startFrame | int | ||
values | Array<float> |
public bufferWrite(bufferID: int, path: String, headerFormat: String, sampleFormat: String, numFramesToWrite: int, startFrameInBuffer: int, leaveFileOpen: int, completionMsg: Array): Array source
import {bufferWrite} from 'supercolliderjs/src/server/osc/msg.js'
Write buffer contents to a sound file.
Not all combinations of header format and sample format are possible.
If number of frames is less than zero, all samples from the starting frame to the end of the buffer are written. If opening a file to be used by DiskOut ugen then you will want to set "leave file open" to one, otherwise set it to zero. If "leave file open" is set to one then the file is created, but no frames are written until the DiskOut ugen does so.
Asynchronous. Replies with /done /b_write bufNum
.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
path | String | path name of a sound file. |
|
headerFormat | String | Header format is one of: "aiff", "next", "wav", "ircam"", "raw" |
|
sampleFormat | String | Sample format is one of: "int8", "int16", "int24", "int32", "float", "double", "mulaw", "alaw" |
|
numFramesToWrite | int | number of frames to write (optional. default = -1, see below) |
|
startFrameInBuffer | int | starting frame in buffer (optional. default = 0) |
|
leaveFileOpen | int | leave file open (optional. default = 0) |
|
completionMsg | Array | (optional) |
public bufferZero(bufferID: int, completionMsg: Array): Array source
import {bufferZero} from 'supercolliderjs/src/server/osc/msg.js'
Sets all samples in the buffer to zero.
Asynchronous. Replies with /done /b_zero bufNum
.
Params:
Name | Type | Attribute | Description |
bufferID | int | ||
completionMsg | Array | (optional) |
public callAndResolve(value: *, context: *, keyName: *): * source
import {callAndResolve} from 'supercolliderjs/src/dryadic/helpers.js'
If value is a function then call it, if function returns a Promise then resolve it.
Params:
Name | Type | Attribute | Description |
value | * | ||
context | * | ||
keyName | * |
Return:
* |
public callAndResolveAll(things: Array, parentContext: Object): Promise source
import {callAndResolveAll} from 'supercolliderjs/src/dryadic/helpers.js'
Call and resolve each of the items in a list
public callAndResolveValues(object: Object, context: Object): Promise source
import {callAndResolveValues} from 'supercolliderjs/src/dryadic/helpers.js'
Call and resolve each of the values of an Object.
public clearSched(): Array source
import {clearSched} from 'supercolliderjs/src/server/osc/msg.js'
Clear all scheduled bundles. Removes all bundles from the scheduling queue.
public cmd(command: *, args: *[]): Array source
import {cmd} from 'supercolliderjs/src/server/osc/msg.js'
Execute a command defined by a UGen Plug-in
Params:
Name | Type | Attribute | Description |
command | * | ||
args | *[] |
|
public compileSynthDef(defName: String, sourceCode: String): * source
import {compileSynthDef} from 'supercolliderjs/src/server/dryads.js'
Compile a SynthDef from a snippet of supercollider source code, send it to the server and stores the SynthDesc in server.state
Return:
* |
public controlBusFill(triples: Array): Array source
import {controlBusFill} from 'supercolliderjs/src/server/osc/msg.js'
Fill ranges of bus value(s).
Set contiguous ranges of buses to single values. For each range, the starting sample index is given followed by the number of buses to change, followed by the value to fill. what is diff to c_setn ?
Params:
Name | Type | Attribute | Description |
triples | Array | [[firstBusID, numBussesToChange, value], ...] |
public controlBusGet(busID: Number): Array source
import {controlBusGet} from 'supercolliderjs/src/server/osc/msg.js'
Get control bus values
Takes a bus ID and replies with the corresponding c_set
command.
Params:
Name | Type | Attribute | Description |
busID | Number | array of bus ids |
public controlBusGetn(startBusIndex: int, numBusses: int): Array source
import {controlBusGetn} from 'supercolliderjs/src/server/osc/msg.js'
Get contiguous ranges of buses. Replies with the corresponding c_setn
command.
Params:
Name | Type | Attribute | Description |
startBusIndex | int | starting bus index |
|
numBusses | int | number of sequential buses to get (M) |
public controlBusSet(pairs: Array): Array source
import {controlBusSet} from 'supercolliderjs/src/server/osc/msg.js'
Takes a list of pairs of bus indices and values and sets the buses to those values.
Params:
Name | Type | Attribute | Description |
pairs | Array | [[busID, value], ...] |
public controlBusSetn(triples: Array): Array source
import {controlBusSetn} from 'supercolliderjs/src/server/osc/msg.js'
Set ranges of bus value(s).
Set contiguous ranges of buses to sets of values. For each range, the starting bus index is given followed by the number of channels to change, followed by the values.
Params:
Name | Type | Attribute | Description |
triples | Array | [[firstBusID, numBussesToChange, value], ...] |
public dB(spec: *): * source
import {dB} from 'supercolliderjs/src/map.js'
Returns dB mapping function (DbFaderWarp)
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public dbToAmp(db: *): * source
import {dbToAmp} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
db | * |
Return:
* |
public defFree(defName: String): Array source
import {defFree} from 'supercolliderjs/src/server/osc/msg.js'
Delete synth definition.
The definition is removed immediately, and does not wait for synth nodes based on that definition to end.
Params:
Name | Type | Attribute | Description |
defName | String |
public defLoad(path: String, completionMsg: Array): Array source
import {defLoad} from 'supercolliderjs/src/server/osc/msg.js'
Load synth definition.
Loads a file of synth definitions. Resident definitions with the same names are overwritten.
Asynchronous. Replies with /done
.
public defLoadDir(path: String, completionMsg: Array): Array source
import {defLoadDir} from 'supercolliderjs/src/server/osc/msg.js'
Load a directory of synth definitions.
Asynchronous. Replies with /done
.
public defRecv(buffer: Buffer, completionMsg: Array): Array source
import {defRecv} from 'supercolliderjs/src/server/osc/msg.js'
Loads a file of synth definitions from a data buffer included in the message. Resident definitions with the same names are overwritten.
Asynchronous. Replies with /done
.
Params:
Name | Type | Attribute | Description |
buffer | Buffer | A node global datatype: new Buffer(array) |
|
completionMsg | Array |
public deltaTimeTag(seconds: Number, now: Date): * source
import {deltaTimeTag} from 'supercolliderjs/src/server/osc/utils.js'
deltaTimeTag(secondsFromNow, [now])
Make NTP timetag array relative to the current time.
Return:
* |
public dryadic(rootDryad: *, moreLayers: *[], rootContext: {}): * source
import {dryadic} from 'supercolliderjs/src/dryads/index.js'
Create a DryadPlayer from a Dryad or hyperscript definition.
Automatically includes the supercollider.js layer
usage:
var sc = require('supercolliderjs'); var player = sc.dryadic([ 'scserver', [ ['group', [ ['synth', { defName: 'sinosc', args: { freq: 440 } }] ] ]); player.play(); ... player.stop();
Params:
Name | Type | Attribute | Description |
rootDryad | * | ||
moreLayers | *[] |
|
|
rootContext | {} |
|
Return:
* |
public dryadic(fn: *, requireSCSynth: boolean, requireSClang: boolean): * source
import {dryadic} from 'supercolliderjs/src/dryadic/helpers.js'
Return:
* |
public dumpOSC(code: int): Array source
import {dumpOSC} from 'supercolliderjs/src/server/osc/msg.js'
Dump incoming OSC messages to stdout
Params:
Name | Type | Attribute | Description |
code | int | 0 turn dumping OFF. 1 print the parsed contents of the message. 2 print the contents in hexadecimal. 3 print both the parsed and hexadecimal representations of the contents. |
public error(on: int): Array source
import {error} from 'supercolliderjs/src/server/osc/msg.js'
Enable/disable error message posting.
Params:
Name | Type | Attribute | Description |
on | int |
public exp(spec: *): * source
import {exp} from 'supercolliderjs/src/map.js'
Returns an exponential mapping function
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public expToLin(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * source
import {expToLin} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
inMin | * | ||
inMax | * | ||
outMin | * | ||
outMax | * | ||
value | * |
Return:
* |
public fader(spec: *): * source
import {fader} from 'supercolliderjs/src/map.js'
Returns amp mapping function (FaderWarp)
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public freeBlock(state: Immutable.Map, addr: int, blockSize: int): Immutable.Map source
import {freeBlock} from 'supercolliderjs/src/server/internals/allocators.js'
Return a previously allocated block back to the free list.
Defragments by merging with adjoining neighbors where possible
Params:
Name | Type | Attribute | Description |
state | Immutable.Map | ||
addr | int | ||
blockSize | int |
Return:
Immutable.Map | state |
public freeBlockList(state: Immutable.Map): Array source
import {freeBlockList} from 'supercolliderjs/src/server/internals/allocators.js'
Returns a list of the free blocks and their sizes.
Params:
Name | Type | Attribute | Description |
state | Immutable.Map |
public freqToMidi(freq: *): * source
import {freqToMidi} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
freq | * |
Return:
* |
public group(children: *): * source
import {group} from 'supercolliderjs/src/server/dryads.js'
Params:
Name | Type | Attribute | Description |
children | * |
Return:
* |
public groupDeepFree(groupID: int): Array source
import {groupDeepFree} from 'supercolliderjs/src/server/osc/msg.js'
Free all synths in this group and all its sub-groups.
Traverses all groups below this group and frees all the synths. Sub-groups are not freed.
Params:
Name | Type | Attribute | Description |
groupID | int |
public groupDumpTree(groupID: int, dumpControlValues: int): Array source
import {groupDumpTree} from 'supercolliderjs/src/server/osc/msg.js'
Post a representation of this group's node subtree to STDOUT
Posts a representation of this group's node subtree, i.e. all the groups and synths contained within it, optionally including the current control values for synths.
Params:
Name | Type | Attribute | Description |
groupID | int | ||
dumpControlValues | int | if not 0 post current control (arg) values for synths to STDOUT |
public groupFreeAll(groupID: int): Array source
import {groupFreeAll} from 'supercolliderjs/src/server/osc/msg.js'
Frees all immediate children nodes in the group
Params:
Name | Type | Attribute | Description |
groupID | int |
public groupHead(groupID: int, nodeID: int, rest: ...int): Array source
import {groupHead} from 'supercolliderjs/src/server/osc/msg.js'
Moves node to the head (first to be executed) of the group.
Params:
Name | Type | Attribute | Description |
groupID | int | ||
nodeID | int | ||
rest | ...int | more node IDs to also move to head |
public groupNew(nodeID: int, addAction: int, targetID: int): Array source
import {groupNew} from 'supercolliderjs/src/server/osc/msg.js'
Create a new group.
Create a new group and add it to the tree of nodes. There are four ways to add the group to the tree as determined by the add action argument
Params:
Name | Type | Attribute | Description |
nodeID | int | new group ID |
|
addAction | int | ||
targetID | int |
public groupQueryTree(groupID: int, dumpControlValues: int): Array source
import {groupQueryTree} from 'supercolliderjs/src/server/osc/msg.js'
Get a representation of this group's node subtree.
Request a representation of this group's node subtree, i.e. all the groups and synths contained within it. Replies to the sender with a /g_queryTree.reply
message listing all of the nodes contained within the group in the following format:
param {int} - flag: if synth control values are included 1, else 0 param {int} nodeID - of the requested group param {int} - number of child nodes contained within the requested group then for each node in the subtree: param {int} nodeID - param {int} - number of child nodes contained within this node. If -1 this is a synth, if >=0 it's a group then, if this node is a synth: strongsymbol the SynthDef name for this node. then, if flag (see above) is true: param {int} - numControls for this synth (M) multiple: param {string|int} - control name or index param {float|String} value or control bus mapping symbol (e.g. 'c1')
N.B. The order of nodes corresponds to their execution order on the server. Thus child nodes (those contained within a group) are listed immediately following their parent. See the method Server:queryAllNodes for an example of how to process this reply.
Params:
Name | Type | Attribute | Description |
groupID | int | ||
dumpControlValues | int | if not 0 the current control (arg) values for synths will be included |
public groupTail(groupID: int, nodeID: int, rest: ...int): Array source
import {groupTail} from 'supercolliderjs/src/server/osc/msg.js'
Moves node to the tail (last to be executed) of the group.
Params:
Name | Type | Attribute | Description |
groupID | int | ||
nodeID | int | ||
rest | ...int | more node IDs to also move to tail |
public h(hgraph: *): * source
import {h} from 'supercolliderjs/src/dryads/index.js'
Convert hyperscript object to a tree of Dryads.
This lookups each class by lower class 'classname' and creates an instance with properties and children.
Params:
Name | Type | Attribute | Description |
hgraph | * |
Return:
* |
public increment(state: int, initial: int): Array source
import {increment} from 'supercolliderjs/src/server/internals/allocators.js'
A simple incrementing allocator used for nodeIds.
The return type is designed to be consistent with the block allocator and other mutating functions used by Server
Params:
Name | Type | Attribute | Description |
state | int | ||
initial | int |
public initialBlockState(initialSize: int): Immutable.Map source
import {initialBlockState} from 'supercolliderjs/src/server/internals/allocators.js'
Create initial state for block allocator.
Params:
Name | Type | Attribute | Description |
initialSize | int | eg. total numChannels |
Return:
Immutable.Map | state |
public interpreter(children: *[], options: {}): * source
import {interpreter} from 'supercolliderjs/src/server/dryads.js'
Boots a new supercollider interpreter making it available for all children
as context.lang
.
Ignores any possibly already existing one in context.
Params:
Name | Type | Attribute | Description |
children | *[] |
|
|
options | {} |
|
Return:
* |
public linToExp(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * source
import {linToExp} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
inMin | * | ||
inMax | * | ||
outMin | * | ||
outMax | * | ||
value | * |
Return:
* |
public linToLin(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * source
import {linToLin} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
inMin | * | ||
inMax | * | ||
outMin | * | ||
outMax | * | ||
value | * |
Return:
* |
public linear(spec: *): * source
import {linear} from 'supercolliderjs/src/map.js'
Returns a linear mapping function
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public makeBundle(time: null | Number | Array | Date, packets: Array): * source
import {makeBundle} from 'supercolliderjs/src/server/osc/utils.js'
Format an object for osc-min bundle
Return:
* |
public makeChildContext(parentContext: *, keyName: *): * source
import {makeChildContext} from 'supercolliderjs/src/dryadic/helpers.js'
Params:
Name | Type | Attribute | Description |
parentContext | * | ||
keyName | * |
Return:
* |
public makeMessage(msg: *): * source
import {makeMessage} from 'supercolliderjs/src/server/osc/utils.js'
Format an object for osc-min message
Params:
Name | Type | Attribute | Description |
msg | * |
Return:
* |
public mapWithSpec(value: *, spec: *): * source
import {mapWithSpec} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
value | * | ||
spec | * |
Return:
* |
public midiToFreq(midiNote: *): * source
import {midiToFreq} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
midiNote | * |
Return:
* |
public nodeAfter(moveNodeID: int, afterNodeID: int): Array source
import {nodeAfter} from 'supercolliderjs/src/server/osc/msg.js'
Places node A in the same group as node B, to execute immediately after node B.
Params:
Name | Type | Attribute | Description |
moveNodeID | int | the ID of the node to place (A) |
|
afterNodeID | int | the ID of the node after which the above is placed (B) |
public nodeBefore(moveNodeID: int, beforeNodeID: int): Array source
import {nodeBefore} from 'supercolliderjs/src/server/osc/msg.js'
Places node A in the same group as node B, to execute immediately before node B.
Params:
Name | Type | Attribute | Description |
moveNodeID | int | the node to move (A) |
|
beforeNodeID | int | the node to move A before |
public nodeFill(nodeID: int, triples: Array): Array source
import {nodeFill} from 'supercolliderjs/src/server/osc/msg.js'
Fill ranges of a node's control value(s).
Set contiguous ranges of control indices to single values. For each range, the starting control index is given followed by the number of controls to change, followed by the value to fill. If the node is a group, then it sets the controls of every node in the group.
Params:
Name | Type | Attribute | Description |
nodeID | int | ||
triples | Array | [[key, numValuesToFill, value], ...] |
public nodeFree(nodeID: int): Array source
import {nodeFree} from 'supercolliderjs/src/server/osc/msg.js'
Delete/free a node
Params:
Name | Type | Attribute | Description |
nodeID | int |
public nodeMap(nodeID: int, pairs: Array | Object): Array source
import {nodeMap} from 'supercolliderjs/src/server/osc/msg.js'
Map a node's controls to read from a bus.
Return:
Array | OSC message Takes a list of pairs of control names or indices and bus indices and causes those controls to be read continuously from a global control bus. If the node is a group, then it maps the controls of every node in the group. If the control bus index is -1 then any current mapping is undone. Any n_set, n_setn and n_fill command will also unmap the control. |
public nodeMapAudio(nodeID: int, pairs: Array): Array source
import {nodeMapAudio} from 'supercolliderjs/src/server/osc/msg.js'
Map a node's controls to read from an audio bus.
Takes a list of pairs of control names or indices and audio bus indices and causes those controls to be read continuously from a global audio bus. If the node is a group, then it maps the controls of every node in the group. If the audio bus index is -1 then any current mapping is undone. Any n_set, n_setn and n_fill command will also unmap the control. For the full audio rate signal, the argument must have its rate set to \ar.
Params:
Name | Type | Attribute | Description |
nodeID | int | ||
pairs | Array | [[controlName|index, audioBusID], ...] |
public nodeMapAudion(nodeID: int, triples: Array): Array source
import {nodeMapAudion} from 'supercolliderjs/src/server/osc/msg.js'
Map a node's controls to read from audio buses.
Params:
Name | Type | Attribute | Description |
nodeID | int | ||
triples | Array | [[controlName|index, audioBusID, numControlsToMap], ...] |
Return:
Array | OSC message Takes a list of triples of control names or indices, audio bus indices, and number of controls to map and causes those controls to be mapped sequentially to buses. If the node is a group, then it maps the controls of every node in the group. If the audio bus index is -1 then any current mapping is undone. Any n_set, n_setn and n_fill command will also unmap the control. For the full audio rate signal, the argument must have its rate set to \ar. |
public nodeMapn(nodeID: int, triples: Array): Array source
import {nodeMapn} from 'supercolliderjs/src/server/osc/msg.js'
Map a node's controls to read from buses.
Takes a list of triples of control names or indices, bus indices, and number of controls to map and causes those controls to be mapped sequentially to buses. If the node is a group, then it maps the controls of every node in the group. If the control bus index is -1 then any current mapping is undone. Any n_set, n_setn and n_fill command will also unmap the control.
Params:
Name | Type | Attribute | Description |
nodeID | int | ||
triples | Array | [[controlName|index, busID, numControlsToMap], ...] |
public nodeOrder(addAction: int, targetID: int, nodeIDs: Array<int>): Array source
import {nodeOrder} from 'supercolliderjs/src/server/osc/msg.js'
Move and order a list of nodes.
Move the listed nodes to the location specified by the target and add action, and place them in the order specified. Nodes which have already been freed will be ignored.
Params:
Name | Type | Attribute | Description |
addAction | int | ||
targetID | int | ||
nodeIDs | Array<int> |
public nodeQuery(nodeID: int): Array source
import {nodeQuery} from 'supercolliderjs/src/server/osc/msg.js'
Get info about a node.
The server sends an /n_info message for each node to registered clients. See Node Notifications for the format of the /n_info message.
Params:
Name | Type | Attribute | Description |
nodeID | int |
public nodeRun(nodeID: int, on: int): Array source
import {nodeRun} from 'supercolliderjs/src/server/osc/msg.js'
Stop/start a node from running
Save computation by turning a node (and its children) off but without removing it from the UGen graph
Params:
Name | Type | Attribute | Description |
nodeID | int | ||
on | int | binary boolean |
public nodeSet(nodeID: int, pairs: Object | Array): Array source
import {nodeSet} from 'supercolliderjs/src/server/osc/msg.js'
Set a node's control value(s).
Takes a list of pairs of control indices and values and sets the controls to those values. If the node is a group, then it sets the controls of every node in the group.
This message now supports array type tags ($[ and $]) in the control/value component of the OSC message. Arrayed control values are applied in the manner of n_setn (i.e., sequentially starting at the indexed or named control).
I think this also takes [freq, 440],
Example:
nodeSet(id, [[0, 440], ...])
public nodeSetn(nodeID: int, valueSets: Array): Array source
import {nodeSetn} from 'supercolliderjs/src/server/osc/msg.js'
Set ranges of a node's control value(s).
Set contiguous ranges of control indices to sets of values. For each range, the starting control index is given followed by the number of controls to change, followed by the values. If the node is a group, then it sets the controls of every node in the group.
Params:
Name | Type | Attribute | Description |
nodeID | int | ||
valueSets | Array | [[controlName|index, numValues, value1, ... valueN], ...] |
public nodeTrace(nodeID: int): Array source
import {nodeTrace} from 'supercolliderjs/src/server/osc/msg.js'
Trace a node.
Causes a synth to print out the values of the inputs and outputs of its unit generators for one control period. Causes a group to print the node IDs and names of each node in the group for one control period.
Params:
Name | Type | Attribute | Description |
nodeID | int |
public nonRealTimeEnd(): Array source
import {nonRealTimeEnd} from 'supercolliderjs/src/server/osc/msg.js'
End real time mode, close file. Not yet implemented on server
This message should be sent in a bundle in non real time mode.
The bundle timestamp will establish the ending time of the file.
This command will end non real time mode and close the sound file.
Replies with /done
.
public notify(on: int): Array source
import {notify} from 'supercolliderjs/src/server/osc/msg.js'
Register to receive notifications from server
Asynchronous. Replies with /done /notify clientID
. If this client has registered for notifications before, this may be the same ID. Otherwise it will be a new one. Clients can use this ID in multi-client situations to avoid conflicts in node IDs, bus indices, buffer numbers, etc.
Params:
Name | Type | Attribute | Description |
on | int | start or stop If argument is 1, server will remember your return address and send you notifications. 0 will stop sending notifications. |
public onNodeEnd(server: Server, id: String, nodeID: int, handler: Function): Function source
import {onNodeEnd} from 'supercolliderjs/src/server/node-watcher.js'
Call a function when the server sends an /n_end message One callback allowed per id and node.
public onNodeGo(server: Server, id: String, nodeID: int, handler: Function): Function source
import {onNodeGo} from 'supercolliderjs/src/server/node-watcher.js'
Call a function when the server sends an /n_go message One callback allowed per id and node The id is usually a context id but could be a random guid
public parallelGroupNew(groupID: int, addAction: int, targetID: int): Array source
import {parallelGroupNew} from 'supercolliderjs/src/server/osc/msg.js'
Create a new parallel group. supernova only
Create a new parallel group and add it to the tree of nodes. Parallel groups are relaxed groups, their child nodes are evaluated in unspecified order. There are four ways to add the group to the tree as determined by the add action argument
Multiple groups may be created in one command by adding arguments. (not implemented here)
Params:
Name | Type | Attribute | Description |
groupID | int | new group ID |
|
addAction | int | add action |
|
targetID | int |
public parseMessage(msg: *): * source
import {parseMessage} from 'supercolliderjs/src/server/osc/utils.js'
Convert full OSC message to a simple Array
{address: '/n_go', args: [ Object { type: 'integer', value: 1000 }, Object { type: 'integer', value: 0 }, Object { type: 'integer', value: -1 }, Object { type: 'integer', value: 3 }, Object { type: 'integer', value: 0 } ], oscType: 'message' }
to:
['/n_go', 1000, 0, -1, 3, 0]
Params:
Name | Type | Attribute | Description |
msg | * |
Return:
* |
public play(rootDryad: Dryad | Array): DryadPlayer source
import {play} from 'supercolliderjs/src/dryads/index.js'
Play a Dryad or hyperscript document.
usage:
var sc = require('supercolliderjs'); var player = sc.play([ 'scserver', [ ['group', [ ['synth', { defName: 'sinosc', args: { freq: 440 } }] ] ]);
Params:
Name | Type | Attribute | Description |
rootDryad | Dryad | Array | Dryad object or hyperscript document |
Return:
DryadPlayer |
public putSynthDef(context: *, defName: *, synthDesc: *) source
import {putSynthDef} from 'supercolliderjs/src/server/dryads.js'
store synthDefDesc in server state.
This marks it as having been compiled and sent to server.
Params:
Name | Type | Attribute | Description |
context | * | ||
defName | * | ||
synthDesc | * |
public quit(): Array source
import {quit} from 'supercolliderjs/src/server/osc/msg.js'
Tell server to exit
public requireInterpreter(child: *, options: {}): * source
import {requireInterpreter} from 'supercolliderjs/src/server/dryads.js'
Boots a supercollider interpreter if none is already available
in the context making it available for all children
as context.lang
.
Params:
Name | Type | Attribute | Description |
child | * | ||
options | {} |
|
Return:
* |
public requireServer(child: *, options: {}): * source
import {requireServer} from 'supercolliderjs/src/server/dryads.js'
Boots a supercollider server if none is already available
in the context making it available for all children
as context.server
.
Params:
Name | Type | Attribute | Description |
child | * | ||
options | {} |
|
Return:
* |
public reserveBlock(state: Immutable.Map, addr: int, blockSize: int): Immutable.Map source
import {reserveBlock} from 'supercolliderjs/src/server/internals/allocators.js'
Reserve a block by re-writing the free list
Params:
Name | Type | Attribute | Description |
state | Immutable.Map | ||
addr | int | ||
blockSize | int |
Return:
Immutable.Map | state |
Throw:
* |
Block is already allocated |
public resolveOptions(configPath: String, commandLineOptions: Object): Promise source
import resolveOptions from 'supercolliderjs/src/utils/resolveOptions.js'
load configuration files and merge options into a final dict
public scserver(command: *, context: *): * source
import scserver from 'supercolliderjs/src/dryads/middleware/scserver.js'
Send OSC to the SuperCollider server (scsynth)
Command may have one of these forms:
msg: Array
bundle: { time: null|Number|Array|Date packets: Array of OSC messages }
callAndResponse: { call: response: }
sched: [ { time: null|Number|Array|Date messages: Array of OSC messages } ]
(sched will later use a just-in-time scheduler)
Alternatively you may supply a function that is called with context and returns one of these forms.
Bundle time format
Params:
Name | Type | Attribute | Description |
command | * | ||
context | * |
Return:
* |
public server(children: *[], options: {}): * source
import {server} from 'supercolliderjs/src/server/dryads.js'
Boots a new supercollider server making it available for all children making it available for all children
as context.server
.
Always boots a new one, ignoring any possibly already existing one in context.
Params:
Name | Type | Attribute | Description |
children | *[] |
|
|
options | {} |
|
Return:
* |
public status(): Array source
import {status} from 'supercolliderjs/src/server/osc/msg.js'
Query for server status.
Server replies with /status.reply
public stream(streamable: Rx.Observeable): * source
import {stream} from 'supercolliderjs/src/server/dryads.js'
Spawns each item returned by an Rx.Observable stream.
Each item returned by the stream should be a dryad
like synth, group etc. It will be spawned as a child of this stream
dryad.
Params:
Name | Type | Attribute | Description |
streamable | Rx.Observeable | a stream that pushes dryads to be spawned |
Return:
* |
public sync(id: int): Array source
import {sync} from 'supercolliderjs/src/server/osc/msg.js'
Notify when async commands have completed.
Replies with a /synced
message when all asynchronous commands received before this one have completed. The reply will contain the sent unique ID.
Asynchronous. Replies with /synced ID
.
Params:
Name | Type | Attribute | Description |
id | int | a unique number identifying this command. |
public synth(synthDefName: String | Function, args: Object): Function source
import {synth} from 'supercolliderjs/src/server/dryads.js'
Generates a function that will spawn a Synth when it is called
When the function is called, it returns a Promise that will -- when the Synth has succesfully started playing -- resolve with the Synth's nodeID.
Params:
Name | Type | Attribute | Description |
synthDefName | String | Function | the name of the synthDef or a function that can be called and resolve to a synthDef name |
|
args | Object | Arguments may be int|float|string If an argument is a function then it will be called. If that returns a Promise then it will be resolved and the result of that is the final value passed to the Synth. |
public synthGet(synthID: int, controlNames: Array.<int | String>): Array source
import {synthGet} from 'supercolliderjs/src/server/osc/msg.js'
Get control value(s).
Params:
Name | Type | Attribute | Description |
synthID | int | ||
controlNames | Array.<int | String> | index or names |
public synthGetn(synthID: int, controlName: int | String, n: int): Array source
import {synthGetn} from 'supercolliderjs/src/server/osc/msg.js'
Get ranges of control value(s).
Params:
Name | Type | Attribute | Description |
synthID | int | ||
controlName | int | String | a control index or name |
|
n | int | number of sequential controls to get (M) |
Return:
Array | OSC message Get contiguous ranges of controls. Replies with the corresponding |
public synthNew(defName: String, nodeID: int, addAction: int, targetID: int, args: Object): Array source
import {synthNew} from 'supercolliderjs/src/server/osc/msg.js'
Create a new synth.
Create a new synth from a named, compiled and already loaded synth definition, give it an ID, and add it to the tree of nodes.
There are four ways to add the node to the tree as determined by the add action argument
Controls may be set when creating the synth. The control arguments are the same as for the n_set command.
If you send /s_new with a synth ID of -1, then the server will generate an ID for you. The server reserves all negative IDs. Since you don't know what the ID is, you cannot talk to this node directly later. So this is useful for nodes that are of finite duration and that get the control information they need from arguments and buses or messages directed to their group. In addition no notifications are sent when there are changes of state for this node, such as /n_go
, /n_end
, /n_on
, /n_off
.
If you use a node ID of -1 for any other command, such as /n_map
, then it refers to the most recently created node by /s_new
(auto generated ID or not). This is how you can map the controls of a node with an auto generated ID. In a multi-client situation, the only way you can be sure what node -1 refers to is to put the messages in a bundle.
This message now supports array type tags ($[ and $]) in the control/value component of the OSC message. Arrayed control values are applied in the manner of n_setn (i.e., sequentially starting at the indexed or named control). See the linkGuides/NodeMessaging helpfile.
Params:
Name | Type | Attribute | Description |
defName | String | ||
nodeID | int | ||
addAction | int | ||
targetID | int | ||
args | Object | key: a control index or name value: floating point and integer arguments are interpreted as control value. A symbol argument consisting of the letter 'c' or 'a' (for control or audio) followed by the bus's index. |
public synthNoid(synthIDs: Array): Array source
import {synthNoid} from 'supercolliderjs/src/server/osc/msg.js'
Auto-reassign synths' ID to a reserved value.
This command is used when the client no longer needs to communicate with the synth and wants to have the freedom to reuse the ID. The server will reassign this synth to a reserved negative number. This command is purely for bookkeeping convenience of the client. No notification is sent when this occurs.
Params:
Name | Type | Attribute | Description |
synthIDs | Array |
public synthStream(streamable: *, params: {}): * source
import {synthStream} from 'supercolliderjs/src/server/dryads.js'
Spawns each event in an Rx.Observeable stream
{defName: "saw", args: {freq: 440}}
Params:
Name | Type | Attribute | Description |
streamable | * | ||
params | {} |
|
Return:
* |
public ugenCmd(nodeID: int, uGenIndex: int, command: String, args: Array): Array source
import {ugenCmd} from 'supercolliderjs/src/server/osc/msg.js'
Send a command to a unit generator.
Sends all arguments following the command name to the unit generator to be performed. Commands are defined by unit generator plug ins.
public unmapDb(spec: *): * source
import {unmapDb} from 'supercolliderjs/src/map.js'
Returns inverse of dB mapping function (DbFaderWarp)
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public unmapExp(spec: *): * source
import {unmapExp} from 'supercolliderjs/src/map.js'
Returns inverse of exponential mapping function
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public unmapFader(spec: *): * source
import {unmapFader} from 'supercolliderjs/src/map.js'
Returns inverse of amp mapping function (FaderWarp)
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public unmapLinear(spec: *): * source
import {unmapLinear} from 'supercolliderjs/src/map.js'
Returns inverse of linear mapping function
Params:
Name | Type | Attribute | Description |
spec | * |
Return:
* |
public unmapWithSpec(value: *, spec: *): * source
import {unmapWithSpec} from 'supercolliderjs/src/map.js'
Params:
Name | Type | Attribute | Description |
value | * | ||
spec | * |
Return:
* |
public updateNodeState(server: *, nodeID: *, nodeState: *) source
import {updateNodeState} from 'supercolliderjs/src/server/node-watcher.js'
Update values in the Server's node state registery
Params:
Name | Type | Attribute | Description |
server | * | ||
nodeID | * | ||
nodeState | * |
public watchNodeNotifications(server: Server): Rx.Disposable source
import {watchNodeNotifications} from 'supercolliderjs/src/server/node-watcher.js'
Watch server OSC receive for any n_XXX messages Save info for node and call any registered callbacks.
Initially there is no need to unwatch unless you are creating and discarding Server objects which can happen during testing. TODO: add Server.destroy
Params:
Name | Type | Attribute | Description |
server | Server |
Return:
Rx.Disposable | sub.dispose(); to turn it off. |
public whenNodeEnd(server: *, id: *, nodeID: *): * source
import {whenNodeEnd} from 'supercolliderjs/src/server/node-watcher.js'
Returns a Promise that resolves when the server sends an /n_end message The id is usually a context id but could be a random guid
Params:
Name | Type | Attribute | Description |
server | * | ||
id | * | ||
nodeID | * |
Return:
* |
public whenNodeGo(server: Server, id: String, nodeID: int): Promise source
import {whenNodeGo} from 'supercolliderjs/src/server/node-watcher.js'
Returns a Promise that resolves when the server sends an /n_go message The id is usually a context id but could be a random guid