servers

class AsyncServer

Bases: supriya.realtime.servers.BaseServer

__contains__(expr)
async boot(*, ip_address: str = '127.0.0.1', port: int = 57110, scsynth_path: Optional[str] = None, options: Optional[supriya.scsynth.Options] = None, **kwargs) supriya.realtime.servers.AsyncServer
property boot_future
async connect(*, ip_address: str = '127.0.0.1', port: int = 57110) supriya.realtime.servers.AsyncServer
property default_group: int
async disconnect() supriya.realtime.servers.AsyncServer
async query(include_controls=True) supriya.querytree.QueryTreeGroup
async quit(force: bool = False) supriya.realtime.servers.AsyncServer
property quit_future
class BaseServer

Bases: object

property audio_bus_allocator
property buffer_allocator
property client_id: int
property control_bus_allocator
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
property options: supriya.scsynth.Options
property osc_protocol
property port: int
property process_protocol
send(message)
property status
class Server

Bases: supriya.realtime.servers.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: Union[int, str]) Union[supriya.realtime.buffers.Buffer, supriya.realtime.buses.Bus, supriya.realtime.nodes.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 "/Users/josiah/Source/github.com/josiah-wolf-oberholtzer/supriya/supriya/realtime/servers.py", line 526, 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: Optional[int] = None, frame_count: Optional[int] = None, starting_frame: Optional[int] = None, file_path: Optional[os.PathLike] = None) supriya.realtime.buffers.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: Optional[int] = None, frame_count: Optional[int] = None) supriya.realtime.buffers.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: Optional[Union[supriya.enums.CalculationRate, SupportsInt, str]] = CalculationRate.CONTROL) supriya.realtime.buses.Bus

Add a bus.

>>> server = supriya.Server().boot()
>>> server.add_bus()
<+ Bus: 0 (control)>
add_bus_group(bus_count: int = 1, calculation_rate: Optional[Union[supriya.enums.CalculationRate, SupportsInt, str]] = CalculationRate.CONTROL) supriya.realtime.buses.BusGroup

Add a bus group.

>>> server = supriya.Server().boot()
>>> server.add_bus_group(4, "audio")
<+ BusGroup{4}: 16 (audio)>
add_group(add_action: Optional[Union[supriya.enums.AddAction, SupportsInt, str]] = None) supriya.realtime.nodes.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: Optional[Union[supriya.enums.AddAction, SupportsInt, str]] = None, **kwargs) supriya.realtime.nodes.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) supriya.realtime.servers.Server
property audio_input_bus_group: Optional[supriya.realtime.buses.AudioInputBusGroup]
property audio_output_bus_group: Optional[supriya.realtime.buses.AudioOutputBusGroup]
boot(*, ip_address: str = '127.0.0.1', port: int = 57110, scsynth_path: Optional[str] = None, options: Optional[supriya.scsynth.Options] = None, **kwargs) supriya.realtime.servers.Server
connect(*, ip_address: str = '127.0.0.1', port: int = 57110) supriya.realtime.servers.Server
property default_group: Optional[supriya.realtime.nodes.Group]
disconnect() supriya.realtime.servers.Server
property meters
query(include_controls=True) supriya.querytree.QueryTreeGroup
quit(force: bool = False) supriya.realtime.servers.Server
reboot(options: Optional[supriya.scsynth.Options] = None, **kwargs) supriya.realtime.servers.Server
property recorder
reset() supriya.realtime.servers.Server
property root_node: Optional[supriya.realtime.nodes.RootNode]
sync(sync_id: Optional[int] = None) supriya.realtime.servers.Server