SynthDefReceiveRequest

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.commands" { graph [label="supriya.commands"]; node [color=2]; "supriya.commands.Request.Request" [URL="../api/supriya/commands/Request.html#supriya.commands.Request.Request", label=Request, shape=oval, style=bold, target=_top]; "supriya.commands.Requestable.Requestable" [URL="../api/supriya/commands/Requestable.html#supriya.commands.Requestable.Requestable", label=Requestable, target=_top]; "supriya.commands.SynthDefReceiveRequest.SynthDefReceiveRequest" [URL="../api/supriya/commands/SynthDefReceiveRequest.html#supriya.commands.SynthDefReceiveRequest.SynthDefReceiveRequest", color=black, fontcolor=white, label="Synth\nDef\nReceive\nRequest", target=_top]; "supriya.commands.Request.Request" -> "supriya.commands.SynthDefReceiveRequest.SynthDefReceiveRequest"; "supriya.commands.Requestable.Requestable" -> "supriya.commands.Request.Request"; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/commands/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; "supriya.system.SupriyaValueObject.SupriyaValueObject" [URL="../api/supriya/commands/../system/SupriyaValueObject.html#supriya.system.SupriyaValueObject.SupriyaValueObject", label="Supriya\nValue\nObject", target=_top]; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.system.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaValueObject.SupriyaValueObject" -> "supriya.commands.Requestable.Requestable"; }

class supriya.commands.SynthDefReceiveRequest.SynthDefReceiveRequest(callback=None, synthdefs=None, use_anonymous_names=None)[source]

A /d_recv request.

>>> import supriya
>>> server = supriya.Server().boot()
>>> with supriya.SynthDefBuilder(out=0, value=0.5) as builder:
...     _ = supriya.ugens.Out.ar(
...         bus=builder['out'],
...         source=supriya.ugens.DC.ar(builder['value']),
...         )
...
>>> synthdef = builder.build(name='example')
>>> synthdef in server
False
>>> print(server.query_remote_nodes())
NODE TREE 0 group
    1 group

Allocate a synthdef, then allocate a new group and allocate a synth in that group using the newly allocated synthdef:

>>> request = supriya.commands.SynthDefReceiveRequest(
...     synthdefs=[synthdef],
...     callback=supriya.commands.RequestBundle(
...         contents=[
...             supriya.commands.GroupNewRequest(
...                 items=[
...                     supriya.commands.GroupNewRequest.Item(
...                         node_id=1000,
...                         target_node_id=1,
...                         ),
...                     ],
...                 ),
...             supriya.commands.SynthNewRequest(
...                 node_id=1001,
...                 synthdef=synthdef,
...                 target_node_id=1000,
...                 ),
...             ],
...         ),
...     )
>>> with server.osc_io.capture() as transcript:
...     response = request.communicate(server=server)
...     _ = server.sync()
...
>>> response
DoneResponse(
    action=('/d_recv',),
    )
>>> for entry in transcript:
...     (entry.label, entry.message)
...
('S', OscMessage(5, bytearray(b'SCgf...example...'), OscBundle(
    contents=(
        OscMessage(21, 1000, 0, 1),
        OscMessage(9, 'example', 1001, 0, 1000),
        ),
    )))
('R', OscMessage('/n_go', 1000, 1, -1, -1, 1, -1, -1))
('R', OscMessage('/n_go', 1001, 1000, -1, -1, 0))
('R', OscMessage('/done', '/d_recv'))
('S', OscMessage(52, 0))
('R', OscMessage('/synced', 0))
>>> print(server.query_remote_nodes(True))
NODE TREE 0 group
    1 group
        1000 group
            1001 example
                out: 0.0, value: 0.5
>>> print(server.query_local_nodes(True))
NODE TREE 0 group
    1 group
        1000 group
            1001 example
                out: 0.0, value: 0.5
>>> synthdef in server
True

Attributes Summary

callback
request_id
response_patterns
synthdefs
to_osc
use_anonymous_names

Special methods

(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)

Return self==value.

(SupriyaValueObject).__hash__()

Return hash(self).

(SupriyaObject).__repr__()

Return repr(self).


Methods

(Requestable).communicate(server=None, sync=True, timeout=1.0, apply_local=True)
(Request).to_datagram()
(Request).to_list(with_request_name=False)
to_osc(with_request_name=False)[source]

Read-only properties

callback
(Requestable).condition
(Request).request_name
(Requestable).response
response_patterns
synthdefs
use_anonymous_names