servers

class AsyncServer

Bases: BaseServer

__contains__(expr)
async boot(*, options: Options | None = None, **kwargs) AsyncServer
property boot_future : Future
async connect(*, options: Options | None = None, **kwargs) AsyncServer
property default_group : int
async disconnect() AsyncServer
async query(include_controls=True) QueryTreeGroup
async quit(force: bool = False) AsyncServer
property quit_future : Future
class BaseServer

Bases: object

property audio_bus_allocator : BlockAllocator
property buffer_allocator : BlockAllocator
property client_id : int
property control_bus_allocator : BlockAllocator
property ip_address : str
property is_owner : bool
property is_running : bool
property latency : float
property maximum_logins : int
property next_sync_id : int
property node_id_allocator : NodeIdAllocator
property options : Options
property osc_protocol : OscProtocol
property port : int
property process_protocol : ProcessProtocol
send(message)
property status : StatusResponse
class Server

Bases: BaseServer

An scsynth server proxy.

>>> import supriya.realtime
>>> server = supriya.realtime.Server()
>>> server.boot()
<Server: udp://127.0.0.1:57110, 8i8o>
>>> server.quit()
<Server: offline>
__contains__(expr)
__getitem__(item: int | str) Buffer | Bus | Node

Get item from server.

>>> server = supriya.Server().boot()
>>> supriya.Synth(name="foo").allocate(server)
<+ Synth: 1000 default (foo)>
>>> server[1000]
<+ Synth: 1000 default (foo)>
>>> server["foo"]
<+ Synth: 1000 default (foo)>
>>> server["b10"]
<+ Buffer: 10, 1ch, 1>
>>> server["a0"]
<+ Bus: 0 (audio)>
>>> server["c16"]
<+ Bus: 16 (control)>
>>> server = server.quit()
>>> server["c16"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/runner/work/supriya/supriya/supriya/realtime/servers.py", line 529, in __getitem__
    raise ServerOffline
supriya.exceptions.ServerOffline
__graph__()

Graph server.

>>> server = supriya.Server().boot()
>>> group = supriya.Group(
...     [
...         supriya.Synth(),
...         supriya.Group(
...             [
...                 supriya.Synth(),
...                 supriya.Synth(),
...             ]
...         ),
...     ]
... ).allocate(server)
>>> graph = server.__graph__()
>>> print(format(graph, "graphviz"))
digraph G {
    graph [bgcolor=transparent,
        color=lightslategrey,
        dpi=72,
        fontname=Arial,
        outputorder=edgesfirst,
        overlap=prism,
        penwidth=2,
        rankdir=TB,
        ranksep=0.5,
        splines=spline,
        style="dotted, rounded"];
    node [fontname=Arial,
        fontsize=12,
        penwidth=2,
        shape=Mrecord,
        style="filled, rounded"];
    edge [penwidth=2];
    "root-node-0" [fillcolor=lightsalmon2,
        label="{ <f_0_0> RootNode | <f_0_1> id: 0 }"];
    "group-1" [fillcolor=lightsteelblue2,
        label="{ <f_0_0> Group | <f_0_1> id: 1 }"];
    "group-1000" [fillcolor=lightsteelblue2,
        label="{ <f_0_0> Group | <f_0_1> id: 1000 }"];
    "synth-1001" [fillcolor=lightgoldenrod2,
        label="{ <f_0_0> Synth | <f_0_1> id: 1001 }"];
    "group-1002" [fillcolor=lightsteelblue2,
        label="{ <f_0_0> Group | <f_0_1> id: 1002 }"];
    "synth-1003" [fillcolor=lightgoldenrod2,
        label="{ <f_0_0> Synth | <f_0_1> id: 1003 }"];
    "synth-1004" [fillcolor=lightgoldenrod2,
        label="{ <f_0_0> Synth | <f_0_1> id: 1004 }"];
    "root-node-0" -> "group-1";
    "group-1" -> "group-1000";
    "group-1000" -> "synth-1001";
    "group-1000" -> "group-1002";
    "group-1002" -> "synth-1003";
    "group-1002" -> "synth-1004";
}
>>> supriya.graph(server)  
add_buffer(channel_count: int | None = None, frame_count: int | None = None, file_path: PathLike | None = None, starting_frame: int | None = None) Buffer

Add a buffer.

>>> server = supriya.Server().boot()
>>> server.add_buffer(channel_count=2, frame_count=1024)
<+ Buffer: 0, 2ch, 1024>
add_buffer_group(buffer_count: int = 1, channel_count: int | None = None, frame_count: int | None = None) BufferGroup

Add a buffer group.

>>> server = supriya.Server().boot()
>>> server.add_buffer_group(buffer_count=8, channel_count=1, frame_count=1024)
<+ BufferGroup{8}: 0>
add_bus(calculation_rate: CalculationRate | SupportsInt | str | None = CalculationRate.CONTROL) Bus

Add a bus.

>>> server = supriya.Server().boot()
>>> server.add_bus()
<+ Bus: 0 (control)>
add_bus_group(bus_count: int = 1, calculation_rate: CalculationRate | SupportsInt | str | None = CalculationRate.CONTROL) BusGroup

Add a bus group.

>>> server = supriya.Server().boot()
>>> server.add_bus_group(4, "audio")
<+ BusGroup{4}: 16 (audio)>
add_group(add_action: AddAction | SupportsInt | str | None = None, parallel: bool = False) Group

Add a group relative to the default group via add_action.

>>> server = supriya.Server().boot()
>>> print(server.query())
NODE TREE 0 group
    1 group
>>> group = server.add_group()
>>> print(server.query())
NODE TREE 0 group
    1 group
        1000 group
add_synth(synthdef=None, add_action: AddAction | SupportsInt | str | None = None, **kwargs) Synth

Add a synth relative to the default group via add_action.

>>> server = supriya.Server().boot()
>>> print(server.query())
NODE TREE 0 group
    1 group
>>> synth = server.add_synth()
>>> print(server.query())
NODE TREE 0 group
    1 group
        1000 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
add_synthdef(synthdef) Server
property audio_input_bus_group : AudioInputBusGroup | None
property audio_output_bus_group : AudioOutputBusGroup | None
boot(*, options: Options | None = None, **kwargs) Server
connect(*, options: Options | None = None, **kwargs) Server
property default_group : Group | None
disconnect() Server
property meters
query(include_controls=True) QueryTreeGroup
quit(force: bool = False) Server
reboot(*, options: Options | None = None, **kwargs) Server
property recorder
reset() Server
property root_node : RootNode | None
sync(sync_id: int | None = None) Server