Home Reference Source
public class | source

Server

Extends:

events~EventEmitter → Server

Constructor Summary

Public Constructor
public

constructor(options: Object, stateStore: Store)

Member Summary

Public Members
public

address: *

public
public

log: *

public

options: *

public

osc: *

public

process: *

public
public

receive: *

public

send: *

public

state: *

public

stdout: *

Method Summary

Public Methods
public

args(): array

Format command line args for scsynth

public

Boot the server

public

callAndResponse(callAndResponse: Object, timeout: int): Promise

Send an OSC command that expects a reply from the server, and resolves with the response.

public

Establish connection to scsynth via OSC socket

public

oscOnce(matchArgs: Array, timeout: int): Promise

Wait for a single OSC response from server matching the supplied args.

public

quit()

quit

public

sendMsg(address: String, args: Array)

this method was deprecated. - use: `server.send.msg([address, arg1, arg2])``

Send OSC message to server

Public Constructors

public constructor(options: Object, stateStore: Store) source

Params:

NameTypeAttributeDescription
options Object

command line options for scsynth

stateStore Store

optional parent Store for allocators and node watchers

Public Members

public address: * source

public isRunning: boolean source

public log: * source

public options: * source

public osc: * source

public process: * source

public processEvents: * source

public receive: * source

public send: * source

public state: * source

public stdout: * source

Public Methods

public args(): array source

Format command line args for scsynth

not yet fully implemented

Return:

array

list of non-default args

public boot(): Promise source

Boot the server

Start scsynth and establish a pipe connection to receive stdout and stderr.

Does not connect, so UDP is not yet ready for OSC communication.

listen for system events and emit: exit out error

Return:

Promise

public callAndResponse(callAndResponse: Object, timeout: int): Promise source

Send an OSC command that expects a reply from the server, and resolves with the response.

This is for getting responses async from the server. The first part of the message matches the expected args, and the rest of the message contains the response.

Params:

NameTypeAttributeDescription
callAndResponse Object

Object with call: [osc_msg, 1, 2], response: [osc_response, 1, 2, 3]

timeout int

in milliseconds before rejecting the Promise

Return:

Promise

resolves with all values the server responsed with after the matched response.

public connect(): Promise source

Establish connection to scsynth via OSC socket

Return:

Promise

resolves when udp responds

public oscOnce(matchArgs: Array, timeout: int): Promise source

Wait for a single OSC response from server matching the supplied args.

This is for getting responses async from the server. The first part of the message matches the expected args, and the rest of the message contains the response.

The Promise fullfills with any remaining payload including in the message.

Params:

NameTypeAttributeDescription
matchArgs Array

osc message to match as a single array: [/done, /notify]

timeout int

in milliseconds before the Promise is rejected

Return:

Promise

public quit() source

quit

kill scsynth process TODO: should send /quit first for shutting files

public sendMsg(address: String, args: Array) source

this method was deprecated. - use: `server.send.msg([address, arg1, arg2])``

Send OSC message to server

Params:

NameTypeAttributeDescription
address String

OSC command, referred to as address

args Array