Synth

class supriya.tools.servertools.Synth(synthdef=None, name=None, register_controls=None, **kwargs)[source]

A synth.

>>> from supriya import servertools
>>> server = servertools.Server()
>>> server.boot()
<Server: udp://127.0.0.1:57751, 8i8o>
>>> from supriya import synthdeftools
>>> from supriya import ugentools
>>> with synthdeftools.SynthDefBuilder(
...     amplitude=0.0,
...     frequency=440.0,
...     ) as builder:
...     sin_osc = ugentools.SinOsc.ar(
...         frequency=builder['frequency'],
...         )
...     sin_osc *= builder['amplitude']
...     out = ugentools.Out.ar(
...         bus=0,
...         source=[sin_osc, sin_osc],
...         )
...
>>> synthdef = builder.build()
>>> synthdef.allocate()
<SynthDef: e41193ac8b7216f49ff0d477876a3bf3>
>>> synth = servertools.Synth(synthdef=synthdef).allocate()
>>> server.quit()
<Server: offline>

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_servertools { graph [label=servertools]; "supriya.tools.servertools.Node.Node" [color=2, group=1, label="Node", shape=oval, style=bold]; "supriya.tools.servertools.ServerObjectProxy.ServerObjectProxy" [color=2, group=1, label=ServerObjectProxy, shape=oval, style=bold]; "supriya.tools.servertools.Synth.Synth" [color=black, fontcolor=white, group=1, label=<<B>Synth</B>>, shape=box, style="filled, rounded"]; "supriya.tools.servertools.Node.Node" -> "supriya.tools.servertools.Synth.Synth"; "supriya.tools.servertools.ServerObjectProxy.ServerObjectProxy" -> "supriya.tools.servertools.Node.Node"; } subgraph cluster_systemtools { graph [label=systemtools]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" [color=3, group=2, label=AbstractBase, shape=box]; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" [color=3, group=2, label=SupriyaObject, shape=box]; "supriya.tools.systemtools.TreeNode.TreeNode" [color=3, group=2, label=TreeNode, shape=box]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" -> "supriya.tools.systemtools.SupriyaObject.SupriyaObject"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.systemtools.TreeNode.TreeNode"; } "builtins.object" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.servertools.ServerObjectProxy.ServerObjectProxy"; "supriya.tools.systemtools.TreeNode.TreeNode" -> "supriya.tools.servertools.Node.Node"; }

Attribute summary

allocate([add_action, node_id_is_permanent, ...])
controls
expr_as_node_id(expr)
expr_as_target(expr)
free()
is_allocated
is_paused
is_running
name
node_id
node_id_is_permanent
parent
parentage
pause()
precede_by(expr)
register_controls
release()
replace_with(expr)
server
succeed_by(expr)
synthdef
unpause()
unrelease()
__eq__(expr) Is true when ID of expr equals ID of Supriya object.
__float__()
__format__([format_specification]) Formats Supriya object.
__getitem__(item)
__hash__() Hashes Supriya object.
__int__()
__repr__()
__setitem__(items, values)
__str__()

Read-only properties

Synth.controls
(Node).is_allocated
(Node).is_paused
(Node).is_running
(Node).node_id
(Node).node_id_is_permanent
(TreeNode).parent
(TreeNode).parentage
Synth.register_controls
(ServerObjectProxy).server
Synth.synthdef

Read/write properties

(TreeNode).name

Methods

Synth.allocate(add_action=None, node_id_is_permanent=False, sync=True, target_node=None, **kwargs)[source]
Synth.free()[source]
(Node).pause()
(TreeNode).precede_by(expr)
Synth.release()[source]
(TreeNode).replace_with(expr)
(TreeNode).succeed_by(expr)
(Node).unpause()
Synth.unrelease()[source]

Class & static methods

(Node).expr_as_node_id(expr)
(Node).expr_as_target(expr)

Special methods

(SupriyaObject).__eq__(expr)

Is true when ID of expr equals ID of Supriya object. Otherwise false.

Returns boolean.

(Node).__float__()
(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

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

Returns string.

Synth.__getitem__(item)[source]
(SupriyaObject).__hash__()

Hashes Supriya object.

Required to be explicitely re-defined on Python 3 if __eq__ changes.

Returns integer.

(Node).__int__()
(Node).__repr__()
Synth.__setitem__(items, values)[source]
Synth.__str__()[source]