scsynth

class AsyncNonrealtimeProcessProtocol

Bases: SubprocessProtocol, ProcessProtocol

connection_made(transport) None

Called when a connection is made.

The argument is the transport representing the pipe connection. To receive data, wait for data_received() calls. When the connection is closed, connection_lost() is called.

pipe_connection_lost(fd, exc) None

Called when a file descriptor associated with the child process is closed.

fd is the int file descriptor that was closed.

pipe_data_received(fd, data) None

Called when the subprocess writes data into stdout/stderr pipe.

fd is int file descriptor. data is bytes object.

process_exited() None

Called when subprocess has exited.

async run(command: list[str], render_directory_path: Path) None
class AsyncProcessProtocol(*, name: str | None = None, on_boot_callback: Callable | None = None, on_panic_callback: Callable | None = None, on_quit_callback: Callable | None = None)

Bases: SubprocessProtocol, ProcessProtocol

async boot(options: Options) None
connection_made(transport) None

Called when a connection is made.

The argument is the transport representing the pipe connection. To receive data, wait for data_received() calls. When the connection is closed, connection_lost() is called.

pipe_connection_lost(fd, exc) None

Called when a file descriptor associated with the child process is closed.

fd is the int file descriptor that was closed.

pipe_data_received(fd, data) None

Called when the subprocess writes data into stdout/stderr pipe.

fd is int file descriptor. data is bytes object.

process_exited() None

Called when subprocess has exited.

async quit() None
class Capture(process_protocol: ProcessProtocol)

Bases: object

__enter__() Capture
__exit__(exc_type, exc_value, traceback) None
__iter__() Iterator[str]
__len__() int
class LineStatus(*values)

Bases: IntEnum

__format__(format_spec, /)

Convert to a string according to format_spec.

CONTINUE = 0
ERROR = 2
READY = 1
class Options(audio_bus_channel_count: int = 1024, block_size: int = 64, buffer_count: int = 1024, control_bus_channel_count: int = 16384, executable: str | None = None, hardware_buffer_size: int | None = None, initial_node_id: int = 1000, input_bus_channel_count: int = 8, input_device: str | None = None, input_stream_mask: str = '', ip_address: str = '127.0.0.1', load_synthdefs: bool = True, maximum_logins: int = 1, maximum_node_count: int = 1024, maximum_synthdef_count: int = 1024, memory_locking: bool = False, memory_size: int = 8192, output_bus_channel_count: int = 8, output_device: str | None = None, output_stream_mask: str = '', password: str | None = None, port: int = 57110, protocol: str = 'udp', random_number_generator_count: int = 64, realtime: bool = True, restricted_path: str | None = None, safety_clip: 'inf' | int | None = None, sample_rate: int | None = None, threads: int = 6, ugen_plugins_path: str | None = None, verbosity: int = 0, wire_buffer_count: int = 64, zero_configuration: bool = False)

Bases: object

SuperCollider server options configuration.

__iter__()
__post_init__()
__replace__(**changes)
get_audio_bus_ids(client_id: int) tuple[int, int]
get_buffer_ids(client_id: int) tuple[int, int]
get_control_bus_ids(client_id: int) tuple[int, int]
get_sync_ids(client_id: int) tuple[int, int]
serialize() list[str]
property first_private_bus_id
property private_audio_bus_channel_count
class ProcessProtocol(*, name: str | None = None, on_boot_callback: Callable | None = None, on_panic_callback: Callable | None = None, on_quit_callback: Callable | None = None)

Bases: object

capture() Capture
class ThreadedProcessProtocol(*, name: str | None = None, on_boot_callback: Callable | None = None, on_panic_callback: Callable | None = None, on_quit_callback: Callable | None = None)

Bases: ProcessProtocol

boot(options: Options) None
quit() None
find(scsynth_path=None)

Find the scsynth executable.

The following paths, if defined, will be searched (prioritised as ordered):

  1. The absolute path scsynth_path

  2. The environment variable SUPRIYA_SERVER_EXECUTABLE (pointing to the scsynth binary)

  3. The user’s PATH

  4. Common installation directories of the SuperCollider application.

Returns a path to the scsynth executable. Raises RuntimeError if no path is found.

kill()