Home Reference Source

Function

Static Public Summary
public

allocBlock(state: Immutable.Map, blockSize: int): Array

Allocates a contigious block of numbers.

public

ampToDb(amp: *): *

public

boot(options: Object, store: Store): Promise

Boot a server with options and connect

public

boot(options: object): Promise

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 DiskOut, close the soundfile and write header information.

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

bufferGen(bufferID: int, command: String, args: Array): Array

Call a command to fill a buffer.

public

bufferGet(bufferID: int, framesArray: Array): *

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

bufferSet(bufferID: int, sets: Array): Array

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

Call and resolve each of the values of an Object.

public

Clear all scheduled bundles.

public

cmd(command: *, args: *[]): Array

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

Fill ranges of bus value(s).

public

Get control bus values

public

controlBusGetn(startBusIndex: int, numBusses: int): Array

Get contiguous ranges of buses.

public

Takes a list of pairs of bus indices and values and sets the buses to those values.

public

Set ranges of bus value(s).

public

dB(spec: *): *

Returns dB mapping function (DbFaderWarp)

public

dbToAmp(db: *): *

public

defFree(defName: String): Array

Delete synth definition.

public

defLoad(path: String, completionMsg: Array): Array

Load synth definition.

public

defLoadDir(path: String, completionMsg: Array): Array

Load a directory of synth definitions.

public

defRecv(buffer: Buffer, completionMsg: Array): Array

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

dryadic(fn: *, requireSCSynth: boolean, requireSClang: boolean): *

public

dumpOSC(code: int): Array

Dump incoming OSC messages to stdout

public

error(on: int): Array

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

groupHead(groupID: int, nodeID: int, rest: ...int): Array

Moves node to the head (first to be executed) of the group.

public

groupNew(nodeID: int, addAction: int, targetID: int): Array

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

groupTail(groupID: int, nodeID: int, rest: ...int): Array

Moves node to the tail (last to be executed) of the group.

public

h(hgraph: *): *

Convert hyperscript object to a tree of Dryads.

public

increment(state: int, initial: int): Array

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 context.lang.

public

linToExp(inMin: *, inMax: *, outMin: *, outMax: *, value: *): *

public

linToLin(inMin: *, inMax: *, outMin: *, outMax: *, value: *): *

public

linear(spec: *): *

Returns a linear mapping function

public

makeBundle(time: null | Number | Array | Date, packets: Array): *

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

nodeAfter(moveNodeID: int, afterNodeID: int): Array

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

nodeFill(nodeID: int, triples: Array): Array

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

nodeFree(nodeID: int): Array

Delete/free a node

public

nodeMap(nodeID: int, pairs: Array | Object): Array

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

nodeMapn(nodeID: int, triples: Array): Array

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

nodeOrder(addAction: int, targetID: int, nodeIDs: Array<int>): Array

Move and order a list of nodes.

public

nodeQuery(nodeID: int): Array

Get info about a node.

public

nodeRun(nodeID: int, on: int): Array

Stop/start a node from running

public

nodeSet(nodeID: int, pairs: Object | Array): Array

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

nodeSetn(nodeID: int, valueSets: Array): Array

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

nodeTrace(nodeID: int): Array

Trace a node.

public

End real time mode, close file.

public

notify(on: int): Array

Register to receive notifications from server

public

onNodeEnd(server: Server, id: String, nodeID: int, handler: Function): Function

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

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(rootDryad: Dryad | Array): DryadPlayer

Play a Dryad or hyperscript document.

public

putSynthDef(context: *, defName: *, synthDesc: *)

store synthDefDesc in server state.

public

quit(): Array

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 context.lang.

public

requireServer(child: *, options: {}): *

Boots a supercollider server if none is already available in the context making it available for all children as context.server.

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 context.server.

public

Query for server status.

public

stream(streamable: Rx.Observeable): *

Spawns each item returned by an Rx.Observable stream.

public

sync(id: int): Array

Notify when async commands have completed.

public

synth(synthDefName: String | Function, args: Object): Function

Generates a function that will spawn a Synth when it is called

public

synthGet(synthID: int, controlNames: Array.<int | String>): Array

Get control value(s).

public

synthGetn(synthID: int, controlName: int | String, n: int): Array

Get ranges of control value(s).

public

synthNew(defName: String, nodeID: int, addAction: int, targetID: int, args: Object): Array

Create a new synth.

public

synthNoid(synthIDs: Array): Array

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

ugenCmd(nodeID: int, uGenIndex: int, command: String, args: Array): Array

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

Allocates a contigious block of numbers.

Params:

NameTypeAttributeDescription
state Immutable.Map
blockSize int

number of numbers eg. numChannels

Return:

Array

[start number {int}, mutated state {Immutable.Map}]

public ampToDb(amp: *): * source

import {ampToDb} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
amp *

Return:

*

public boot(options: Object, store: Store): Promise source

Boot a server with options and connect

Params:

NameTypeAttributeDescription
options Object

command line options for server

store Store

optional external Store to hold Server state

Return:

Promise

resolves with the Server

public boot(options: object): Promise source

alternate constructor resolves options, boots and loads interpreter

Params:

NameTypeAttributeDescription
options object

Return:

Promise

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:

NameTypeAttributeDescription
bufferID int
numFrames int
numChannels int
completionMsg Array

(optional)

Return:

Array

OSC message

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.

Params:

NameTypeAttributeDescription
bufferID int
path String

name of a sound file.

startFrame int

starting frame in file (optional. default = 0)

numFramesToRead int

number of frames to read (optional. default = 0, see below)

completionMsg Array

(optional)

Return:

Array

OSC message

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.

Params:

NameTypeAttributeDescription
bufferID int

buffer number

path String

path name of a sound file

startFrame int

starting frame in file

numFramesToRead int

number of frames to read

channels Array<int>

source file channel index

completionMsg Array

(optional)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
bufferID int

Return:

Array

OSC message

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:

NameTypeAttributeDescription
bufferID int
startFrame int
numFrames int
value float

Return:

Array

OSC message

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:

NameTypeAttributeDescription
bufferID int
completionMsg Array

(optional)

Return:

Array

OSC message

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.

Params:

NameTypeAttributeDescription
bufferID int
command String
args Array

Return:

Array

OSC message

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
bufferID int
startFrame int

starting sample index

numFrames int

number of sequential samples to get (M)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
bufferID int

Return:

Array

OSC message

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:

NameTypeAttributeDescription
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)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
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

Return:

Array

OSC message

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:

NameTypeAttributeDescription
bufferID int
sets Array

[[frame, value], ...]

Return:

Array

OSC message

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:

NameTypeAttributeDescription
bufferID int
startFrame int
values Array<float>

Return:

Array

OSC message

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:

NameTypeAttributeDescription
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)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
bufferID int
completionMsg Array

(optional)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
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

Params:

NameTypeAttributeDescription
things Array
parentContext Object

Return:

Promise

resolves to an Array with the resolved things

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.

Params:

NameTypeAttributeDescription
object Object

whose values will be called and resolved

context Object

which is passed into any Functions

Return:

Promise

resolves to an Object with values mapped to the resolved results

public clearSched(): Array source

import {clearSched} from 'supercolliderjs/src/server/osc/msg.js'

Clear all scheduled bundles. Removes all bundles from the scheduling queue.

Return:

Array

OSC message

public cmd(command: *, args: *[]): Array source

Execute a command defined by a UGen Plug-in

Params:

NameTypeAttributeDescription
command *
args *[]
  • optional
  • default: []

Return:

Array

OSC message

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

Params:

NameTypeAttributeDescription
defName String
sourceCode String

Supports SynthDef, {}, Instr and anything else that responds to .asSynthDef

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:

NameTypeAttributeDescription
triples Array

[[firstBusID, numBussesToChange, value], ...]

Return:

Array

OSC message

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:

NameTypeAttributeDescription
busID Number

array of bus ids

Return:

Array

OSC message

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:

NameTypeAttributeDescription
startBusIndex int

starting bus index

numBusses int

number of sequential buses to get (M)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
pairs Array

[[busID, value], ...]

Return:

Array

OSC message

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:

NameTypeAttributeDescription
triples Array

[[firstBusID, numBussesToChange, value], ...]

Return:

Array

OSC message

public dB(spec: *): * source

import {dB} from 'supercolliderjs/src/map.js'

Returns dB mapping function (DbFaderWarp)

Params:

NameTypeAttributeDescription
spec *

Return:

*

public dbToAmp(db: *): * source

import {dbToAmp} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
db *

Return:

*

public defFree(defName: String): Array source

Delete synth definition.

The definition is removed immediately, and does not wait for synth nodes based on that definition to end.

Params:

NameTypeAttributeDescription
defName String

Return:

Array

OSC message

public defLoad(path: String, completionMsg: Array): Array source

Load synth definition.

Loads a file of synth definitions. Resident definitions with the same names are overwritten. Asynchronous. Replies with /done.

Params:

NameTypeAttributeDescription
path String
completionMsg Array

Return:

Array

OSC message

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.

Params:

NameTypeAttributeDescription
path String
completionMsg Array

Return:

Array

OSC message

public defRecv(buffer: Buffer, completionMsg: Array): Array source

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:

NameTypeAttributeDescription
buffer Buffer

A node global datatype: new Buffer(array)

completionMsg Array

Return:

Array

OSC message

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.

Params:

NameTypeAttributeDescription
seconds Number
now Date

optional

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:

NameTypeAttributeDescription
rootDryad *
moreLayers *[]
  • optional
  • default: []
rootContext {}
  • optional
  • default: {}

Return:

*

public dryadic(fn: *, requireSCSynth: boolean, requireSClang: boolean): * source

Params:

NameTypeAttributeDescription
fn *
requireSCSynth boolean
  • optional
  • default: false
requireSClang boolean
  • optional
  • default: false

Return:

*

public dumpOSC(code: int): Array source

Dump incoming OSC messages to stdout

Params:

NameTypeAttributeDescription
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.

Return:

Array

OSC message

public error(on: int): Array source

Enable/disable error message posting.

Params:

NameTypeAttributeDescription
on int

Return:

Array

OSC message

public exp(spec: *): * source

import {exp} from 'supercolliderjs/src/map.js'

Returns an exponential mapping function

Params:

NameTypeAttributeDescription
spec *

Return:

*

public expToLin(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * source

import {expToLin} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
inMin *
inMax *
outMin *
outMax *
value *

Return:

*

public fader(spec: *): * source

import {fader} from 'supercolliderjs/src/map.js'

Returns amp mapping function (FaderWarp)

Params:

NameTypeAttributeDescription
spec *

Return:

*

public freeBlock(state: Immutable.Map, addr: int, blockSize: int): Immutable.Map source

Return a previously allocated block back to the free list.

Defragments by merging with adjoining neighbors where possible

Params:

NameTypeAttributeDescription
state Immutable.Map
addr int
blockSize int

Return:

Immutable.Map

state

public freeBlockList(state: Immutable.Map): Array source

Returns a list of the free blocks and their sizes.

Params:

NameTypeAttributeDescription
state Immutable.Map

Return:

Array

[[addr, size], ...]

public freqToMidi(freq: *): * source

import {freqToMidi} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
freq *

Return:

*

public group(children: *): * source

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
groupID int

Return:

Array

OSC message

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:

NameTypeAttributeDescription
groupID int
dumpControlValues int

if not 0 post current control (arg) values for synths to STDOUT

Return:

Array

OSC message

public groupFreeAll(groupID: int): Array source

import {groupFreeAll} from 'supercolliderjs/src/server/osc/msg.js'

Frees all immediate children nodes in the group

Params:

NameTypeAttributeDescription
groupID int

Return:

Array

OSC message

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:

NameTypeAttributeDescription
groupID int
nodeID int
rest ...int

more node IDs to also move to head

Return:

Array

OSC message

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:

NameTypeAttributeDescription
nodeID int

new group ID

addAction int
targetID int

Return:

Array

OSC message

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:

NameTypeAttributeDescription
groupID int
dumpControlValues int

if not 0 the current control (arg) values for synths will be included

Return:

Array

OSC message

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:

NameTypeAttributeDescription
groupID int
nodeID int
rest ...int

more node IDs to also move to tail

Return:

Array

OSC message

public h(hgraph: *): * source

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:

NameTypeAttributeDescription
hgraph *

Return:

*

public increment(state: int, initial: int): Array source

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:

NameTypeAttributeDescription
state int
initial int

Return:

Array

[next {int}, state {int}]

public initialBlockState(initialSize: int): Immutable.Map source

import {initialBlockState} from 'supercolliderjs/src/server/internals/allocators.js'

Create initial state for block allocator.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
children *[]
  • optional
  • default: []
options {}
  • optional
  • default: {}

Return:

*

public linToExp(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * source

import {linToExp} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
inMin *
inMax *
outMin *
outMax *
value *

Return:

*

public linToLin(inMin: *, inMax: *, outMin: *, outMax: *, value: *): * source

import {linToLin} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
inMin *
inMax *
outMin *
outMax *
value *

Return:

*

public linear(spec: *): * source

import {linear} from 'supercolliderjs/src/map.js'

Returns a linear mapping function

Params:

NameTypeAttributeDescription
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

Params:

NameTypeAttributeDescription
time null | Number | Array | Date

null means now, immediately unix timestamp in seconds [secondsSince1900Jan1, fractionalSeconds] javascript Date object

packets Array

osc messages as [address, arg1, ...argN] or bundles as Objects: .timeTag .packets

Return:

*

public makeChildContext(parentContext: *, keyName: *): * source

import {makeChildContext} from 'supercolliderjs/src/dryadic/helpers.js'

Params:

NameTypeAttributeDescription
parentContext *
keyName *

Return:

*

public makeMessage(msg: *): * source

import {makeMessage} from 'supercolliderjs/src/server/osc/utils.js'

Format an object for osc-min message

Params:

NameTypeAttributeDescription
msg *

Return:

*

public mapWithSpec(value: *, spec: *): * source

import {mapWithSpec} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
value *
spec *

Return:

*

public midiToFreq(midiNote: *): * source

import {midiToFreq} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
moveNodeID int

the ID of the node to place (A)

afterNodeID int

the ID of the node after which the above is placed (B)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
moveNodeID int

the node to move (A)

beforeNodeID int

the node to move A before

Return:

Array

OSC message

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:

NameTypeAttributeDescription
nodeID int
triples Array

[[key, numValuesToFill, value], ...]

Return:

Array

OSC message

public nodeFree(nodeID: int): Array source

import {nodeFree} from 'supercolliderjs/src/server/osc/msg.js'

Delete/free a node

Params:

NameTypeAttributeDescription
nodeID int

Return:

Array

OSC message

public nodeMap(nodeID: int, pairs: Array | Object): Array source

Map a node's controls to read from a bus.

Params:

NameTypeAttributeDescription
nodeID int
pairs Array | Object

[[controlName, busID], ...]

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:

NameTypeAttributeDescription
nodeID int
pairs Array

[[controlName|index, audioBusID], ...]

Return:

Array

OSC message

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
nodeID int
triples Array

[[controlName|index, busID, numControlsToMap], ...]

Return:

Array

OSC message

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:

NameTypeAttributeDescription
addAction int
targetID int
nodeIDs Array<int>

Return:

Array

OSC message

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:

NameTypeAttributeDescription
nodeID int

Return:

Array

OSC message

public nodeRun(nodeID: int, on: int): Array source

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:

NameTypeAttributeDescription
nodeID int
on int

binary boolean

Return:

Array

OSC message

public nodeSet(nodeID: int, pairs: Object | Array): Array source

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],

Params:

NameTypeAttributeDescription
nodeID int
pairs Object | Array

[[key, value], ...] or Object(key: value, ...)

Return:

Array

OSC message

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:

NameTypeAttributeDescription
nodeID int
valueSets Array

[[controlName|index, numValues, value1, ... valueN], ...]

Return:

Array

OSC message

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:

NameTypeAttributeDescription
nodeID int

Return:

Array

OSC message

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.

Return:

Array

OSC message

public notify(on: int): Array source

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:

NameTypeAttributeDescription
on int

start or stop If argument is 1, server will remember your return address and send you notifications. 0 will stop sending notifications.

Return:

Array

OSC message

public onNodeEnd(server: Server, id: String, nodeID: int, handler: Function): Function source

Call a function when the server sends an /n_end message One callback allowed per id and node.

Params:

NameTypeAttributeDescription
server Server
id String

unique id for this callback registration

nodeID int
handler Function

Return:

Function

cancel function

public onNodeGo(server: Server, id: String, nodeID: int, handler: Function): Function source

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

Params:

NameTypeAttributeDescription
server Server
id String

unique id for this callback registration

nodeID int
handler Function

Return:

Function

cancel function

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:

NameTypeAttributeDescription
groupID int

new group ID

addAction int

add action

targetID int

Return:

Array

OSC message

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:

NameTypeAttributeDescription
msg *

Return:

*

public play(rootDryad: Dryad | Array): DryadPlayer source

Play a Dryad or hyperscript document.

usage:

var sc = require('supercolliderjs'); var player = sc.play([ 'scserver', [ ['group', [ ['synth', { defName: 'sinosc', args: { freq: 440 } }] ] ]);

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
context *
defName *
synthDesc *

public quit(): Array source

Tell server to exit

Return:

Array

OSC message

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:

NameTypeAttributeDescription
child *
options {}
  • optional
  • default: {}

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:

NameTypeAttributeDescription
child *
options {}
  • optional
  • default: {}

Return:

*

public reserveBlock(state: Immutable.Map, addr: int, blockSize: int): Immutable.Map source

Reserve a block by re-writing the free list

Params:

NameTypeAttributeDescription
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

Params:

NameTypeAttributeDescription
configPath String

explicit path to a yaml config file otherwise tries .supercollider.yaml ~/.supercollider.yaml

commandLineOptions Object

a dict of options to be merged over the loaded config. eg. supplied command line options --sclang=/some/path/to/sclang

Return:

Promise

public scserver(command: *, context: *): * source

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:

NameTypeAttributeDescription
command *
context *

Return:

*

public server(children: *[], options: {}): * source

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:

NameTypeAttributeDescription
children *[]
  • optional
  • default: []
options {}
  • optional
  • default: {}

Return:

*

public status(): Array source

Query for server status.

Server replies with /status.reply

Return:

Array

OSC message

public stream(streamable: Rx.Observeable): * source

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:

NameTypeAttributeDescription
streamable Rx.Observeable

a stream that pushes dryads to be spawned

Return:

*

public sync(id: int): Array source

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:

NameTypeAttributeDescription
id int

a unique number identifying this command.

Return:

Array

OSC message

public synth(synthDefName: String | Function, args: Object): Function source

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:

NameTypeAttributeDescription
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.

Return:

Function

when evaluated returns a Promise that resolves with the Synth starts

public synthGet(synthID: int, controlNames: Array.<int | String>): Array source

import {synthGet} from 'supercolliderjs/src/server/osc/msg.js'

Get control value(s).

Params:

NameTypeAttributeDescription
synthID int
controlNames Array.<int | String>

index or names

Return:

Array

OSC message

Replies with the corresponding /n_set command.

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:

NameTypeAttributeDescription
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 /n_setn command.

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:

NameTypeAttributeDescription
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.

Return:

Array

OSC message

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:

NameTypeAttributeDescription
synthIDs Array

Return:

Array

OSC message

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:

NameTypeAttributeDescription
streamable *
params {}
  • optional
  • default: {}

Return:

*

public ugenCmd(nodeID: int, uGenIndex: int, command: String, args: Array): Array source

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.

Params:

NameTypeAttributeDescription
nodeID int
uGenIndex int

unit generator index

command String
args Array

Return:

Array

OSC message

public unmapDb(spec: *): * source

import {unmapDb} from 'supercolliderjs/src/map.js'

Returns inverse of dB mapping function (DbFaderWarp)

Params:

NameTypeAttributeDescription
spec *

Return:

*

public unmapExp(spec: *): * source

import {unmapExp} from 'supercolliderjs/src/map.js'

Returns inverse of exponential mapping function

Params:

NameTypeAttributeDescription
spec *

Return:

*

public unmapFader(spec: *): * source

import {unmapFader} from 'supercolliderjs/src/map.js'

Returns inverse of amp mapping function (FaderWarp)

Params:

NameTypeAttributeDescription
spec *

Return:

*

public unmapLinear(spec: *): * source

import {unmapLinear} from 'supercolliderjs/src/map.js'

Returns inverse of linear mapping function

Params:

NameTypeAttributeDescription
spec *

Return:

*

public unmapWithSpec(value: *, spec: *): * source

import {unmapWithSpec} from 'supercolliderjs/src/map.js'

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
server *
id *
nodeID *

Return:

*

public whenNodeGo(server: Server, id: String, nodeID: int): Promise source

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

Params:

NameTypeAttributeDescription
server Server
id String

unique id for this callback registration

nodeID int

Return:

Promise

resolves with nodeID

public withContext(parentContext: Object | undefined, requireSCSynth: Boolean, requireSClang: Boolean): * source

import {withContext} from 'supercolliderjs/src/dryadic/helpers.js'

Create a context, inheriting from parentContext.

Params:

NameTypeAttributeDescription
parentContext Object | undefined
requireSCSynth Boolean

will boot server if required

requireSClang Boolean

will boot language interpreter if required

Return:

*