SynthDefBuilder

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_supriya.synthdefs" { graph [label="supriya.synthdefs"]; node [color=2]; "supriya.synthdefs.SynthDefBuilder.SynthDefBuilder" [URL="../api/supriya/synthdefs/SynthDefBuilder.html#supriya.synthdefs.SynthDefBuilder.SynthDefBuilder", color=black, fontcolor=white, label="Synth\nDef\nBuilder", target=_top]; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/synthdefs/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.synthdefs.SynthDefBuilder.SynthDefBuilder"; }

class supriya.synthdefs.SynthDefBuilder.SynthDefBuilder(name=None, **kwargs)[source]

A SynthDef builder.

>>> import supriya.synthdefs
>>> import supriya.ugens
>>> builder = supriya.synthdefs.SynthDefBuilder(
...     frequency=440,
...     trigger=supriya.synthdefs.Parameter(
...         value=0,
...         parameter_rate=supriya.synthdefs.ParameterRate.TRIGGER,
...         ),
...     )
>>> with builder:
...     sin_osc = supriya.ugens.SinOsc.ar(
...         frequency=builder['frequency'],
...         )
...     decay = supriya.ugens.Decay.kr(
...         decay_time=0.5,
...         source=builder['trigger'],
...         )
...     enveloped_sin = sin_osc * decay
...     out = supriya.ugens.Out.ar(bus=0, source=enveloped_sin)
...
>>> synthdef = builder.build()
>>> graph(synthdef)  

Attributes Summary

__enter__
__exit__
__getitem__
build
name
poll_ugen

Special methods

__enter__()[source]
__exit__(exc_type, exc_value, traceback)[source]
__getitem__(item)[source]
(SupriyaObject).__repr__()

Return repr(self).


Methods

build(name=None, optimize=True)[source]
poll_ugen(ugen, label=None, trigger=None, trigger_id=-1)[source]

Read-only properties

name