Envelope

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.Envelope.Envelope" [URL="../api/supriya/synthdefs/Envelope.html#supriya.synthdefs.Envelope.Envelope", color=black, fontcolor=white, label=Envelope, 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]; "supriya.system.SupriyaValueObject.SupriyaValueObject" [URL="../api/supriya/synthdefs/../system/SupriyaValueObject.html#supriya.system.SupriyaValueObject.SupriyaValueObject", label="Supriya\nValue\nObject", target=_top]; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.system.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaValueObject.SupriyaValueObject" -> "supriya.synthdefs.Envelope.Envelope"; }

class supriya.synthdefs.Envelope.Envelope(amplitudes=(0, 1, 0), durations=(1, 1), curves=('linear', 'linear'), release_node=None, loop_node=None, offset=None)[source]

An envelope.

>>> envelope = supriya.synthdefs.Envelope()
>>> envelope
Envelope()
>>> envelope.serialize()
[0.0, 2, -99, -99, 1.0, 1.0, 1, 0.0, 0.0, 1.0, 1, 0.0]

Attributes Summary

amplitudes
ar
asr
curves
duration
durations
envelope_segments
from_segments
initial_amplitude
kr
linen
loop_node
offset
percussive Make a percussion envelope.
release_node
serialize
triangle Make a triangle envelope.

Special methods

(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)

Return self==value.

(SupriyaValueObject).__hash__()

Return hash(self).

(SupriyaObject).__repr__()

Return repr(self).


Methods

ar(**kwargs)[source]
kr(**kwargs)[source]
serialize(for_interpolation=False)[source]

Class & static methods

classmethod asr(attack_time=0.01, sustain=1.0, release_time=1.0, curve=-4.0)[source]
classmethod from_segments(initial_amplitude=0, segments=None, release_node=None, loop_node=None, offset=None)[source]
classmethod linen(attack_time=0.01, sustain_time=1.0, release_time=1.0, level=1.0, curve=1)[source]
classmethod percussive(attack_time=0.01, release_time=1.0, amplitude=1.0, curve=-4.0)[source]

Make a percussion envelope.

>>> import supriya.synthdefs
>>> envelope = supriya.synthdefs.Envelope.percussive()
>>> envelope
Envelope(
    curves=(-4.0, -4.0),
    durations=(0.01, 1.0),
    )
>>> envelope.serialize()
[0.0, 2, -99, -99, 1.0, 0.01, 5, -4.0, 0.0, 1.0, 5, -4.0]
classmethod triangle(duration=1.0, amplitude=1.0)[source]

Make a triangle envelope.

>>> import supriya.synthdefs
>>> envelope = supriya.synthdefs.Envelope.triangle()
>>> envelope
Envelope(
    durations=(0.5, 0.5),
    )
>>> envelope.serialize()
[0.0, 2, -99, -99, 1.0, 0.5, 1, 0.0, 0.0, 0.5, 1, 0.0]

Read-only properties

amplitudes
curves
duration
durations
envelope_segments
initial_amplitude
loop_node
offset
release_node