QueryTreeGroup

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

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_collections { graph [label=collections]; "collections.abc.Container" [color=2, group=1, label=Container, shape=oval, style=bold]; "collections.abc.Iterable" [color=2, group=1, label=Iterable, shape=oval, style=bold]; "collections.abc.Sequence" [color=2, group=1, label=Sequence, shape=oval, style=bold]; "collections.abc.Sized" [color=2, group=1, label=Sized, shape=oval, style=bold]; "collections.abc.Container" -> "collections.abc.Sequence"; "collections.abc.Iterable" -> "collections.abc.Sequence"; "collections.abc.Sized" -> "collections.abc.Sequence"; } subgraph cluster_responsetools { graph [label=responsetools]; "supriya.tools.responsetools.QueryTreeGroup.QueryTreeGroup" [color=black, fontcolor=white, group=2, label=<<B>QueryTreeGroup</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_systemtools { graph [label=systemtools]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" [color=4, group=3, label=AbstractBase, shape=box]; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" [color=4, group=3, label=SupriyaObject, shape=box]; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" [color=4, group=3, label=SupriyaValueObject, shape=box]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" -> "supriya.tools.systemtools.SupriyaObject.SupriyaObject"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "collections.abc.Container"; "builtins.object" -> "collections.abc.Iterable"; "builtins.object" -> "collections.abc.Sized"; "builtins.object" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "collections.abc.Sequence" -> "supriya.tools.responsetools.QueryTreeGroup.QueryTreeGroup"; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" -> "supriya.tools.responsetools.QueryTreeGroup.QueryTreeGroup"; }

Bases

Attribute summary

children
count(...)
extra
from_group(group[, include_controls])
from_state(state[, include_controls, ...])
index((value, [start, ...) Raises ValueError if the value is not present.
node_id
to_dict() Convert QueryTreeGroup to JSON-serializable dictionary.
__contains__(value)
__copy__(*args)
__eq__(expr)
__format__([format_specification]) Formats Supriya object.
__getitem__(item)
__hash__()
__iter__()
__len__()
__repr__() Gets interpreter representation of Supriya object.
__reversed__()
__str__()

Read-only properties

QueryTreeGroup.children
QueryTreeGroup.extra
QueryTreeGroup.node_id

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.

QueryTreeGroup.to_dict()[source]

Convert QueryTreeGroup to JSON-serializable dictionary.

>>> query_tree_group = responsetools.QueryTreeGroup(
...     node_id=1002,
...     children=(
...         responsetools.QueryTreeSynth(
...             node_id=1105,
...             synthdef_name='dca557070c6b57164557041ac746fb3f',
...             controls=(
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='damping',
...                     control_value=0.06623425334692,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='duration',
...                     control_value=3.652155876159668,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='level',
...                     control_value=0.894767701625824,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='out',
...                     control_value=16.0,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='room_size',
...                     control_value=0.918643176555634,
...                     ),
...                 ),
...             ),
...         responsetools.QueryTreeSynth(
...             node_id=1098,
...             synthdef_name='cc754c63533fdcf412a44ef6adb1a8f0',
...             controls=(
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='duration',
...                     control_value=5.701356887817383,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='level',
...                     control_value=0.959683060646057,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='out',
...                     control_value=16.0,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='pitch_dispersion',
...                     control_value=0.040342573076487,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='pitch_shift',
...                     control_value=10.517594337463379,
...                     ),
...                 responsetools.QueryTreeControl(
...                     control_name_or_index='time_dispersion',
...                     control_value=0.666014134883881,
...                     ),
...                 responsetools.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 QueryTreeGroup.from_group(group, include_controls=False)[source]
classmethod QueryTreeGroup.from_state(state, include_controls=False, include_timespans=False)[source]

Special methods

(Sequence).__contains__(value)
(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)
(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

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

Returns string.

QueryTreeGroup.__getitem__(item)[source]
(SupriyaValueObject).__hash__()
(Sequence).__iter__()
QueryTreeGroup.__len__()[source]
(SupriyaObject).__repr__()

Gets interpreter representation of Supriya object.

Returns string.

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