Server

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph cluster_builtins { graph [label=builtins]; node [color=1]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_supriya.realtime" { graph [label="supriya.realtime"]; node [color=2]; "supriya.realtime.Server.Server" [URL="../api/supriya/realtime/Server.html#supriya.realtime.Server.Server", color=black, fontcolor=white, label=Server, target=_top]; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/realtime/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.realtime.Server.Server"; }

class supriya.realtime.Server.Server(ip_address='127.0.0.1', port=57751)[source]

An scsynth server proxy.

>>> import supriya.realtime
>>> server = supriya.realtime.Server.get_default_server()
>>> server.boot()
<Server: udp://127.0.0.1:57751, 8i8o>
>>> server.quit()
<Server: offline>

Attributes Summary

__contains__
__enter__
__exit__
__getitem__ Get item from server.
__graph__ Graph server.
__new__ Create and return a new object.
__repr__ Return repr(self).
__str__ Return str(self).
audio_bus_allocator
audio_input_bus_group
audio_output_bus_group
boot
buffer_allocator
control_bus_allocator
debug_osc
debug_request_names
debug_subprocess
debug_udp
default_group
get_default_server
ip_address
is_running
latency
meters
next_sync_id
node_id_allocator
osc_io
port
query_local_nodes Queries all node proxies in Python.
query_remote_nodes Queries all nodes on scsynth.
quit
reboot
recorder
root_node
send_message
server_options
status
sync

Special methods

__contains__(expr)[source]
__enter__()[source]
__exit__(exc_type, exc_value, traceback)[source]
__getitem__(item)[source]

Get item from server.

>>> server = supriya.Server().boot()
>>> supriya.Synth(name='foo').allocate()
<+ Synth: 1000 (foo)>
>>> server[1000]
<+ Synth: 1000 (foo)>
>>> server['foo']
<+ Synth: 1000 (foo)>
>>> server['b10']
<+ Buffer: 10>
>>> server['a0']
<+ Bus: 0 (audio)>
>>> server['c16']
<+ Bus: 16 (control)>
>>> server = server.quit()
>>> server['c16']
Traceback (most recent call last):
...
supriya.exceptions.ServerOffline
__graph__()[source]

Graph server.

>>> import supriya
>>> server = supriya.Server().boot()
>>> group = supriya.Group([
...     supriya.Synth(),
...     supriya.Group([
...         supriya.Synth(),
...         supriya.Synth(),
...         ]),
...     ]).allocate()
>>> 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)  
static __new__(cls, ip_address='127.0.0.1', port=57751, **kwargs)[source]

Create and return a new object. See help(type) for accurate signature.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).


Methods

boot(scsynth_path=None, server_options=None, **kwargs)[source]
query_local_nodes(include_controls=False)[source]

Queries all node proxies in Python.

>>> import supriya.realtime
>>> server = supriya.realtime.Server()
>>> server.boot()
<Server: udp://127.0.0.1:57751, 8i8o>
>>> group_a = supriya.realtime.Group().allocate()
>>> group_b = supriya.realtime.Group().allocate()
>>> group_c = supriya.realtime.Group().allocate(target_node=group_a)
>>> import supriya.synthdefs
>>> import supriya.ugens
>>> with supriya.synthdefs.SynthDefBuilder(
...     amplitude=0.0,
...     frequency=440.0,
...     ) as builder:
...     sin_osc = supriya.ugens.SinOsc.ar(
...         frequency=builder['frequency'],
...         )
...     sin_osc *= builder['amplitude']
...     out = supriya.ugens.Out.ar(
...         bus=0,
...         source=[sin_osc, sin_osc],
...         )
...
>>> synthdef = builder.build()
>>> synthdef.allocate()
<SynthDef: e41193ac8b7216f49ff0d477876a3bf3>
>>> synth = supriya.realtime.Synth(synthdef).allocate(
...     target_node=group_b,
...     )
>>> response = server.query_remote_nodes(include_controls=True)
>>> print(response)
NODE TREE 0 group
    1 group
        1001 group
            1003 e41193ac8b7216f49ff0d477876a3bf3
                amplitude: 0.0, frequency: 440.0
        1000 group
            1002 group
>>> server.quit()
<Server: offline>

Returns server query-tree group response.

query_remote_nodes(include_controls=False)[source]

Queries all nodes on scsynth.

>>> import supriya.realtime
>>> server = supriya.realtime.Server()
>>> server.boot()
<Server: udp://127.0.0.1:57751, 8i8o>
>>> group_a = supriya.realtime.Group().allocate()
>>> group_b = supriya.realtime.Group().allocate()
>>> group_c = supriya.realtime.Group().allocate(target_node=group_a)
>>> import supriya.synthdefs
>>> import supriya.ugens
>>> with supriya.synthdefs.SynthDefBuilder(
...     amplitude=0.0,
...     frequency=440.0,
...     ) as builder:
...     sin_osc = supriya.ugens.SinOsc.ar(
...         frequency=builder['frequency'],
...         )
...     sin_osc *= builder['amplitude']
...     out = supriya.ugens.Out.ar(
...         bus=0,
...         source=[sin_osc, sin_osc],
...         )
...
>>> synthdef = builder.build()
>>> synthdef.allocate()
<SynthDef: e41193ac8b7216f49ff0d477876a3bf3>
>>> synth = supriya.realtime.Synth(synthdef).allocate(
...     target_node=group_b,
...     )
>>> response = server.query_local_nodes(include_controls=False)
>>> print(response)
NODE TREE 0 group
    1 group
        1001 group
            1003 e41193ac8b7216f49ff0d477876a3bf3
        1000 group
            1002 group
>>> server.quit()
<Server: offline>

Returns server query-tree group response.

quit()[source]
reboot()[source]
send_message(message, with_request_name=False)[source]
sync(sync_id=None)[source]

Class & static methods

static get_default_server()[source]

Read/write properties

debug_osc
debug_request_names
debug_subprocess
debug_udp
latency

Read-only properties

audio_bus_allocator
audio_input_bus_group
audio_output_bus_group
buffer_allocator
control_bus_allocator
default_group
ip_address
is_running
meters
next_sync_id
node_id_allocator
osc_io
port
recorder
root_node
server_options
status