NodeBeforeRequest

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.MoveRequest.MoveRequest" [URL="../api/supriya/commands/MoveRequest.html#supriya.commands.MoveRequest.MoveRequest", label="Move\nRequest", shape=oval, style=bold, target=_top]; "supriya.commands.NodeBeforeRequest.NodeBeforeRequest" [URL="../api/supriya/commands/NodeBeforeRequest.html#supriya.commands.NodeBeforeRequest.NodeBeforeRequest", color=black, fontcolor=white, label="Node\nBefore\nRequest", target=_top]; "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.MoveRequest.MoveRequest" -> "supriya.commands.NodeBeforeRequest.NodeBeforeRequest"; "supriya.commands.Request.Request" -> "supriya.commands.MoveRequest.MoveRequest"; "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.NodeBeforeRequest.NodeBeforeRequest(node_id_pairs=None)[source]

An /n_before request.

>>> import supriya
>>> server = supriya.Server().boot()
>>> group_a = supriya.Group([supriya.Group(), supriya.Group()])
>>> group_b = supriya.Group([supriya.Group(), supriya.Group()])
>>> synth_a = supriya.Synth()
>>> synth_b = supriya.Synth()
>>> server.default_group.extend([synth_a, synth_b, group_a, group_b])
>>> print(server.query_remote_nodes())
NODE TREE 0 group
    1 group
        1000 default
        1001 default
        1002 group
            1003 group
            1004 group
        1005 group
            1006 group
            1007 group
>>> request = supriya.commands.NodeBeforeRequest([
...     [synth_a, group_a[0]],
...     [synth_b, group_b],
...     ])
>>> request.to_osc(True)
OscMessage('/n_before', 1000, 1003, 1001, 1005)
>>> with server.osc_io.capture() as transcript:
...     request.communicate(server=server)
...     _ = server.sync()
...
>>> for entry in transcript:
...     (entry.label, entry.message)
...
('S', OscMessage(18, 1000, 1003, 1001, 1005))
('S', OscMessage(52, 0))
('R', OscMessage('/n_move', 1000, 1002, -1, 1003, 0))
('R', OscMessage('/n_move', 1001, 1, 1002, 1005, 0))
('R', OscMessage('/synced', 0))
>>> print(server.query_remote_nodes())
NODE TREE 0 group
    1 group
        1002 group
            1000 default
            1003 group
            1004 group
        1001 default
        1005 group
            1006 group
            1007 group
>>> print(server.query_local_nodes())
NODE TREE 0 group
    1 group
        1002 group
            1000 default
            1003 group
            1004 group
        1001 default
        1005 group
            1006 group
            1007 group

Attributes Summary

request_id

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)
(MoveRequest).to_osc(with_request_name=False)

Read-only properties

(Requestable).condition
(MoveRequest).node_id_pairs
(Request).request_name
(Requestable).response
(Request).response_patterns