Envelope

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

An envelope.

>>> from supriya.tools import *
>>> envelope = synthdeftools.Envelope()
>>> envelope
Envelope(
    amplitudes=(0.0, 1.0, 0.0),
    durations=(1.0, 1.0),
    curves=('linear', 'linear')
    )
>>> envelope.serialize()
[0.0, 2, -99, -99, 1.0, 1.0, 1, 0.0, 0.0, 1.0, 1, 0.0]

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_synthdeftools { graph [label=synthdeftools]; "supriya.tools.synthdeftools.Envelope.Envelope" [color=black, fontcolor=white, group=1, label=<<B>Envelope</B>>, shape=box, style="filled, rounded"]; } 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.SupriyaValueObject.SupriyaValueObject" [color=3, group=2, 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" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" -> "supriya.tools.synthdeftools.Envelope.Envelope"; }

Bases

Attribute summary

amplitudes
asr([attack_time, release_time, amplitude, ...])
curves
duration
durations
envelope_segments
from_segments([initial_amplitude, segments, ...])
initial_amplitude
loop_node
offset
percussive([attack_time, release_time, ...]) Make a percussion envelope.
release_node
serialize([for_interpolation])
triangle([duration, amplitude]) Make a triangle envelope.
__copy__(*args)
__eq__(expr)
__format__([format_specification]) Formats Supriya object.
__hash__()
__repr__() Gets interpreter representation of Supriya object.

Read-only properties

Envelope.amplitudes
Envelope.curves
Envelope.duration
Envelope.durations
Envelope.envelope_segments
Envelope.initial_amplitude
Envelope.loop_node
Envelope.offset
Envelope.release_node

Methods

Envelope.serialize(for_interpolation=False)[source]

Class & static methods

static Envelope.asr(attack_time=0.01, release_time=1.0, amplitude=1.0, curve=-4.0)[source]
classmethod Envelope.from_segments(initial_amplitude=0, segments=None, release_node=None, loop_node=None, offset=None)[source]
static Envelope.percussive(attack_time=0.01, release_time=1.0, amplitude=1.0, curve=-4.0)[source]

Make a percussion envelope.

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

Make a triangle envelope.

>>> from supriya.tools import synthdeftools
>>> envelope = synthdeftools.Envelope.triangle()
>>> envelope
Envelope(
    amplitudes=(0.0, 1.0, 0.0),
    durations=(0.5, 0.5),
    curves=('linear', 'linear')
    )
>>> envelope.serialize()
[0.0, 2, -99, -99, 1.0, 0.5, 1, 0.0, 0.0, 0.5, 1, 0.0]

Special methods

(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.

(SupriyaValueObject).__hash__()
(SupriyaObject).__repr__()

Gets interpreter representation of Supriya object.

Returns string.