QueryTreeGroup

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_collections.abc" { graph [label="collections.abc"]; node [color=2]; "collections.abc.Collection" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Collection", label=Collection, shape=oval, style=bold, target=_top]; "collections.abc.Container" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Container", label=Container, shape=oval, style=bold, target=_top]; "collections.abc.Iterable" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Iterable", label=Iterable, shape=oval, style=bold, target=_top]; "collections.abc.Reversible" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Reversible", label=Reversible, shape=oval, style=bold, target=_top]; "collections.abc.Sequence" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Sequence", label=Sequence, shape=oval, style=bold, target=_top]; "collections.abc.Sized" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Sized", label=Sized, shape=oval, style=bold, target=_top]; "collections.abc.Collection" -> "collections.abc.Sequence"; "collections.abc.Container" -> "collections.abc.Collection"; "collections.abc.Iterable" -> "collections.abc.Collection"; "collections.abc.Iterable" -> "collections.abc.Reversible"; "collections.abc.Reversible" -> "collections.abc.Sequence"; "collections.abc.Sized" -> "collections.abc.Collection"; } subgraph "cluster_supriya.commands" { graph [label="supriya.commands"]; node [color=3]; "supriya.commands.QueryTreeGroup.QueryTreeGroup" [URL="../api/supriya/commands/QueryTreeGroup.html#supriya.commands.QueryTreeGroup.QueryTreeGroup", color=black, fontcolor=white, label="Query\nTree\nGroup", target=_top]; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=4]; "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" -> "collections.abc.Container"; "builtins.object" -> "collections.abc.Iterable"; "builtins.object" -> "collections.abc.Sized"; "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "collections.abc.Sequence" -> "supriya.commands.QueryTreeGroup.QueryTreeGroup"; "supriya.system.SupriyaValueObject.SupriyaValueObject" -> "supriya.commands.QueryTreeGroup.QueryTreeGroup"; }

class supriya.commands.QueryTreeGroup.QueryTreeGroup(node_id=None, children=None, **extra)[source]

Attributes Summary

__getitem__
__len__
__str__ Return str(self).
children
extra
from_group
from_state
node_id
to_dict Convert QueryTreeGroup to JSON-serializable dictionary.

Special methods

(Sequence).__contains__(value)
(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)

Return self==value.

__getitem__(item)[source]
(SupriyaValueObject).__hash__()

Return hash(self).

(Sequence).__iter__()
__len__()[source]
(SupriyaObject).__repr__()

Return repr(self).

(Sequence).__reversed__()
__str__()[source]

Return str(self).


Methods

(Sequence).count(value) → integer -- return number of occurrences of value
(Sequence).index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

to_dict()[source]

Convert QueryTreeGroup to JSON-serializable dictionary.

>>> query_tree_group = supriya.commands.QueryTreeGroup(
...     node_id=1002,
...     children=(
...         supriya.commands.QueryTreeSynth(
...             node_id=1105,
...             synthdef_name='dca557070c6b57164557041ac746fb3f',
...             controls=(
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='damping',
...                     control_value=0.06623425334692,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='duration',
...                     control_value=3.652155876159668,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='level',
...                     control_value=0.894767701625824,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='out',
...                     control_value=16.0,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='room_size',
...                     control_value=0.918643176555634,
...                     ),
...                 ),
...             ),
...         supriya.commands.QueryTreeSynth(
...             node_id=1098,
...             synthdef_name='cc754c63533fdcf412a44ef6adb1a8f0',
...             controls=(
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='duration',
...                     control_value=5.701356887817383,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='level',
...                     control_value=0.959683060646057,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='out',
...                     control_value=16.0,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='pitch_dispersion',
...                     control_value=0.040342573076487,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='pitch_shift',
...                     control_value=10.517594337463379,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='time_dispersion',
...                     control_value=0.666014134883881,
...                     ),
...                 supriya.commands.QueryTreeControl(
...                     control_name_or_index='window_size',
...                     control_value=1.014111995697021,
...                     ),
...                 ),
...             ),
...         ),
...     )
>>> import json
>>> result = query_tree_group.to_dict()
>>> result = json.dumps(
...     result,
...     indent=4,
...     separators=(',', ': '),
...     sort_keys=True,
...     )
>>> print(result)
{
    "children": [
        {
            "controls": {
                "damping": 0.06623425334692,
                "duration": 3.652155876159668,
                "level": 0.894767701625824,
                "out": 16.0,
                "room_size": 0.918643176555634
            },
            "node_id": 1105,
            "synthdef": "dca557070c6b57164557041ac746fb3f"
        },
        {
            "controls": {
                "duration": 5.701356887817383,
                "level": 0.959683060646057,
                "out": 16.0,
                "pitch_dispersion": 0.040342573076487,
                "pitch_shift": 10.517594337463379,
                "time_dispersion": 0.666014134883881,
                "window_size": 1.014111995697021
            },
            "node_id": 1098,
            "synthdef": "cc754c63533fdcf412a44ef6adb1a8f0"
        }
    ],
    "node_id": 1002
}

Class & static methods

classmethod from_group(group, include_controls=False)[source]
classmethod from_state(state, include_controls=False, include_timespans=False)[source]

Read-only properties

children
extra
node_id