Server

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

An scsynth server proxy.

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

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=1, group=0, label=object, shape=box]; } subgraph cluster_servertools { graph [label=servertools]; "supriya.tools.servertools.Server.Server" [color=black, fontcolor=white, group=1, label=<<B>Server</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_systemtools { graph [label=systemtools]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" [color=3, group=2, label=AbstractBase, shape=box]; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" [color=3, group=2, label=SupriyaObject, shape=box]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" -> "supriya.tools.systemtools.SupriyaObject.SupriyaObject"; } "builtins.object" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.servertools.Server.Server"; }

Bases

Attribute summary

audio_bus_allocator
audio_input_bus_group
audio_output_bus_group
boot([server_options])
buffer_allocator
control_bus_allocator
debug_osc
debug_subprocess
debug_udp
default_group
get_default_server()
ip_address
is_running
latency
meters
next_sync_id
node_id_allocator
port
query_local_nodes([include_controls]) Queries all node proxies in Python.
query_remote_nodes([include_controls]) Queries all nodes on scsynth.
quit()
recorder
register_osc_callback(osc_callback)
register_response_callback(response_callback)
response_dispatcher
root_node
send_message(message)
server_options
status
sync([sync_id])
unregister_osc_callback(osc_callback)
unregister_response_callback(response_callback)
__contains__(expr)
__enter__()
__eq__(expr) Is true when ID of expr equals ID of Supriya object.
__exit__(exc_type, exc_value, traceback)
__format__([format_specification]) Formats Supriya object.
__graph__()
__hash__() Hashes Supriya object.
__new__([ip_address, port])
__repr__()
__str__()

Read-only properties

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

Read/write properties

Server.debug_osc
Server.debug_subprocess
Server.debug_udp
Server.latency

Methods

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

Queries all node proxies in Python.

>>> from supriya import servertools
>>> server = servertools.Server()
>>> server.boot()
<Server: udp://127.0.0.1:57751, 8i8o>
>>> group_a = servertools.Group().allocate()
>>> group_b = servertools.Group().allocate()
>>> group_c = servertools.Group().allocate(target_node=group_a)
>>> from supriya import synthdeftools
>>> from supriya import ugentools
>>> with synthdeftools.SynthDefBuilder(
...     amplitude=0.0,
...     frequency=440.0,
...     ) as builder:
...     sin_osc = ugentools.SinOsc.ar(
...         frequency=builder['frequency'],
...         )
...     sin_osc *= builder['amplitude']
...     out = ugentools.Out.ar(
...         bus=0,
...         source=[sin_osc, sin_osc],
...         )
...
>>> synthdef = builder.build()
>>> synthdef.allocate()
<SynthDef: e41193ac8b7216f49ff0d477876a3bf3>
>>> synth = servertools.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.

Server.query_remote_nodes(include_controls=False)[source]

Queries all nodes on scsynth.

>>> from supriya import servertools
>>> server = servertools.Server()
>>> server.boot()
<Server: udp://127.0.0.1:57751, 8i8o>
>>> group_a = servertools.Group().allocate()
>>> group_b = servertools.Group().allocate()
>>> group_c = servertools.Group().allocate(target_node=group_a)
>>> from supriya import synthdeftools
>>> from supriya import ugentools
>>> with synthdeftools.SynthDefBuilder(
...     amplitude=0.0,
...     frequency=440.0,
...     ) as builder:
...     sin_osc = ugentools.SinOsc.ar(
...         frequency=builder['frequency'],
...         )
...     sin_osc *= builder['amplitude']
...     out = ugentools.Out.ar(
...         bus=0,
...         source=[sin_osc, sin_osc],
...         )
...
>>> synthdef = builder.build()
>>> synthdef.allocate()
<SynthDef: e41193ac8b7216f49ff0d477876a3bf3>
>>> synth = servertools.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.

Server.quit()[source]
Server.register_osc_callback(osc_callback)[source]
Server.register_response_callback(response_callback)[source]
Server.send_message(message)[source]
Server.sync(sync_id=None)[source]
Server.unregister_osc_callback(osc_callback)[source]
Server.unregister_response_callback(response_callback)[source]

Class & static methods

static Server.get_default_server()[source]

Special methods

Server.__contains__(expr)[source]
Server.__enter__()[source]
(SupriyaObject).__eq__(expr)

Is true when ID of expr equals ID of Supriya object. Otherwise false.

Returns boolean.

Server.__exit__(exc_type, exc_value, traceback)[source]
(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

Server.__graph__()[source]
(SupriyaObject).__hash__()

Hashes Supriya object.

Required to be explicitely re-defined on Python 3 if __eq__ changes.

Returns integer.

static Server.__new__(ip_address='127.0.0.1', port=57751, **kwargs)[source]
Server.__repr__()[source]
Server.__str__()[source]