QueryTreeSynth

class supriya.tools.responsetools.QueryTreeSynth(node_id=None, synthdef_name=None, controls=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.QueryTreeSynth.QueryTreeSynth" [color=black, fontcolor=white, group=2, label=<<B>QueryTreeSynth</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.QueryTreeSynth.QueryTreeSynth"; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" -> "supriya.tools.responsetools.QueryTreeSynth.QueryTreeSynth"; }

Bases

Attribute summary

controls
count(...)
extra
from_synth(synth[, include_controls])
index((value, [start, ...) Raises ValueError if the value is not present.
node_id
synthdef_name
to_dict() Convert QueryTreeSynth 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

QueryTreeSynth.controls
QueryTreeSynth.extra
QueryTreeSynth.node_id
QueryTreeSynth.synthdef_name

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.

QueryTreeSynth.to_dict()[source]

Convert QueryTreeSynth to JSON-serializable dictionary.

>>> query_tree_synth = responsetools.QueryTreeSynth(
...     node_id=1001,
...     synthdef_name='c1aa521afab5b0c0ce3d744690951649',
...     controls=(
...         responsetools.QueryTreeControl(
...             control_name_or_index='level',
...             control_value=1.0,
...             ),
...         responsetools.QueryTreeControl(
...             control_name_or_index='out',
...             control_value=0.0,
...             ),
...         ),
...     )
>>> import json
>>> result = query_tree_synth.to_dict()
>>> result = json.dumps(
...     result,
...     indent=4,
...     separators=(',', ': '),
...     sort_keys=True,
...     )
>>> print(result)
{
    "controls": {
        "level": 1.0,
        "out": 0.0
    },
    "node_id": 1001,
    "synthdef": "c1aa521afab5b0c0ce3d744690951649"
}

Class & static methods

classmethod QueryTreeSynth.from_synth(synth, include_controls=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.

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

Gets interpreter representation of Supriya object.

Returns string.

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