ServerState
Holds state for a Server such as node/bus/buffer allocators, node status and SynthDefs compiled.
Each server is stored by its unique address, so multiple Servers can store state in the same global Store object.
Constructor Summary
Public Constructor | ||
public |
constructor(server: Server, store: Store) |
Method Summary
Public Methods | ||
public |
allocAudioBus(numChannels: number): int Allocate an audio bus. |
|
public |
allocBufferID(numConsecutive: int): int Allocate a buffer id. |
|
public |
allocControlBus(numChannels: number): int Allocate a control bus. |
|
public |
freeAudioBus(index: int, numChannels: int) Free a previously allocate audio bus |
|
public |
freeBuffer(index: int, numConsecutive: int) Free a previously allocated buffer id. |
|
public |
freeControlBus(index: int, numChannels: int) Free a previously allocated control bus |
|
public |
Get current state value for the server using an array of keys. |
|
public |
Mutate a value or object in the server state. |
|
public |
nextNodeID(): int Allocates a node ID to be used for making a synth or group |
|
public |
|
Public Constructors
Public Methods
public allocAudioBus(numChannels: number): int source
Allocate an audio bus.
Params:
Name | Type | Attribute | Description |
numChannels | number |
|
Return:
int | numChannels |
public allocBufferID(numConsecutive: int): int source
Allocate a buffer id.
Note that numChannels is specified when creating the buffer. This allocator makes sure that the neighboring buffers are empty.
Params:
Name | Type | Attribute | Description |
numConsecutive | int | consecutively numbered buffers are needed by VOsc and VOsc3. |
Return:
int | buffer id |
public allocControlBus(numChannels: number): int source
Allocate a control bus.
Params:
Name | Type | Attribute | Description |
numChannels | number |
|
Return:
int | numChannels |
public freeAudioBus(index: int, numChannels: int) source
Free a previously allocate audio bus
These require you to remember the channels and it messes it up if you free it wrong. will change to higher level storage.
Params:
Name | Type | Attribute | Description |
index | int | ||
numChannels | int |
public freeBuffer(index: int, numConsecutive: int) source
Free a previously allocated buffer id.
Note that numChannels is specified when creating the buffer.
Params:
Name | Type | Attribute | Description |
index | int | ||
numConsecutive | int | consecutively numbered buffers are needed by VOsc and VOsc3. |
public freeControlBus(index: int, numChannels: int) source
Free a previously allocated control bus
These require you to remember the channels and it messes it up if you free it wrong. will change to higher level storage.
Params:
Name | Type | Attribute | Description |
index | int | ||
numChannels | int |
public getIn(keys: String, notSetValue: any): any source
Get current state value for the server using an array of keys.
Params:
Name | Type | Attribute | Description |
keys | String | list of keys eg. ['NODE_WATCHER', 'n_go', 1000] |
|
notSetValue | any | default value to return if empty |
Return:
any |
public nextNodeID(): int source
Allocates a node ID to be used for making a synth or group
Return:
int |