movement

class GroupHeadRequest(node_id_pairs=None)

Bases: supriya.commands.movement.MoveRequest

A /g_head request.

>>> server = supriya.Server().boot()
>>> group = supriya.Group().allocate(server)
>>> synth = supriya.Synth().allocate(server)
>>> group.extend([supriya.Group(), supriya.Group()])
>>> print(server.query())
NODE TREE 0 group
    1 group
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1000 group
            1002 group
            1003 group
>>> request = supriya.commands.GroupHeadRequest([(synth, group)])
>>> request.to_osc()
OscMessage('/g_head', 1000, 1001)
>>> with server.osc_protocol.capture() as transcript:
...     response = request.communicate(server=server)
...     _ = server.sync()
... 
>>> response
>>> for entry in transcript:
...     (entry.label, entry.message)
... 
('S', OscMessage('/g_head', 1000, 1001))
('S', OscMessage('/sync', 1))
('R', OscMessage('/n_move', 1001, 1000, -1, 1002, 0))
('R', OscMessage('/synced', 1))
>>> print(server.query())
NODE TREE 0 group
    1 group
        1000 group
            1001 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
            1002 group
            1003 group
>>> print(server.root_node)
NODE TREE 0 group
    1 group
        1000 group
            1001 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
            1002 group
            1003 group
class GroupTailRequest(node_id_pairs=None)

Bases: supriya.commands.movement.MoveRequest

A /g_tail request.

>>> server = supriya.Server().boot()
>>> group = supriya.Group().allocate(server)
>>> synth = supriya.Synth().allocate(server)
>>> group.extend([supriya.Group(), supriya.Group()])
>>> print(server.query())
NODE TREE 0 group
    1 group
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1000 group
            1002 group
            1003 group
>>> request = supriya.commands.GroupTailRequest([(synth, group)])
>>> request.to_osc()
OscMessage('/g_tail', 1000, 1001)
>>> with server.osc_protocol.capture() as transcript:
...     response = request.communicate(server=server)
...     _ = server.sync()
... 
>>> response
>>> for entry in transcript:
...     (entry.label, entry.message)
... 
('S', OscMessage('/g_tail', 1000, 1001))
('S', OscMessage('/sync', 1))
('R', OscMessage('/n_move', 1001, 1000, 1003, -1, 0))
('R', OscMessage('/synced', 1))
>>> print(server.query())
NODE TREE 0 group
    1 group
        1000 group
            1002 group
            1003 group
            1001 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
>>> print(server.root_node)
NODE TREE 0 group
    1 group
        1000 group
            1002 group
            1003 group
            1001 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
class MoveRequest(node_id_pairs=None)

Bases: supriya.commands.bases.Request

property node_id_pairs
to_osc(*, with_placeholders=False)
class NodeAfterRequest(node_id_pairs=None)

Bases: supriya.commands.movement.MoveRequest

An /n_after request.

>>> 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())
NODE TREE 0 group
    1 group
        1000 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1002 group
            1003 group
            1004 group
        1005 group
            1006 group
            1007 group
>>> request = supriya.commands.NodeAfterRequest(
...     [
...         [synth_a, group_a[-1]],
...         [synth_b, group_b],
...     ]
... )
>>> request.to_osc()
OscMessage('/n_after', 1000, 1004, 1001, 1005)
>>> with server.osc_protocol.capture() as transcript:
...     request.communicate(server=server)
...     _ = server.sync()
... 
>>> for entry in transcript:
...     (entry.label, entry.message)
... 
('S', OscMessage('/n_after', 1000, 1004, 1001, 1005))
('S', OscMessage('/sync', 0))
('R', OscMessage('/n_move', 1000, 1002, 1004, -1, 0))
('R', OscMessage('/n_move', 1001, 1, 1005, -1, 0))
('R', OscMessage('/synced', 0))
>>> print(server.query())
NODE TREE 0 group
    1 group
        1002 group
            1003 group
            1004 group
            1000 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1005 group
            1006 group
            1007 group
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
>>> print(server.root_node)
NODE TREE 0 group
    1 group
        1002 group
            1003 group
            1004 group
            1000 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1005 group
            1006 group
            1007 group
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
class NodeBeforeRequest(node_id_pairs=None)

Bases: supriya.commands.movement.MoveRequest

An /n_before request.

>>> 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())
NODE TREE 0 group
    1 group
        1000 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        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()
OscMessage('/n_before', 1000, 1003, 1001, 1005)
>>> with server.osc_protocol.capture() as transcript:
...     request.communicate(server=server)
...     _ = server.sync()
... 
>>> for entry in transcript:
...     (entry.label, entry.message)
... 
('S', OscMessage('/n_before', 1000, 1003, 1001, 1005))
('S', OscMessage('/sync', 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())
NODE TREE 0 group
    1 group
        1002 group
            1000 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
            1003 group
            1004 group
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1005 group
            1006 group
            1007 group
>>> print(server.root_node)
NODE TREE 0 group
    1 group
        1002 group
            1000 default
                out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
            1003 group
            1004 group
        1001 default
            out: 0.0, amplitude: 0.1, frequency: 440.0, gate: 1.0, pan: 0.5
        1005 group
            1006 group
            1007 group