envelopes

class Done(*, calculation_rate: CalculationRate | SupportsInt | str | None, source: SupportsFloat | UGenScalar, **kwargs)

Bases: UGen

Triggers when source sets its done flag.

>>> source = supriya.ugens.Line.kr()
>>> done = supriya.ugens.Done.kr(
...     source=source,
... )
>>> done
<Done.kr()[0]>
classmethod kr(*, source: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property source : UGenScalar
class EnvGen(*, calculation_rate: CalculationRate | SupportsInt | str | None, gate: SupportsFloat | UGenScalar = 1.0, level_scale: SupportsFloat | UGenScalar = 1.0, level_bias: SupportsFloat | UGenScalar = 0.0, time_scale: SupportsFloat | UGenScalar = 1.0, done_action: SupportsFloat | UGenScalar = 0.0, envelope: UGenSerializable | Sequence[SupportsFloat | UGenScalar], **kwargs)

Bases: UGen

An envelope generator.

>>> from supriya.ugens import Envelope, EnvGen
>>> EnvGen.ar(envelope=Envelope.percussive())
<EnvGen.ar()[0]>
classmethod ar(*, gate: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, level_scale: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, level_bias: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 0.0, time_scale: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, done_action: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 0.0, envelope: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
classmethod kr(*, gate: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, level_scale: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, level_bias: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 0.0, time_scale: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, done_action: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 0.0, envelope: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property done_action : UGenScalar
property envelope : UGenVector
property gate : UGenScalar
property level_bias : UGenScalar
property level_scale : UGenScalar
property time_scale : UGenScalar
class Envelope(amplitudes: Sequence[UGenOperable | float] = (0, 1, 0), durations: Sequence[UGenOperable | float] = (1, 1), curves: Sequence[EnvelopeShape | UGenOperable | float | str | None] = (EnvelopeShape.LINEAR, EnvelopeShape.LINEAR), release_node: int | None = None, loop_node: int | None = None, offset: UGenOperable | float = 0.0)

Bases: object

An envelope.

>>> from supriya.ugens import Envelope
>>> envelope = Envelope()
>>> list(envelope.serialize())
[<0.0>, <2.0>, <-99.0>, <-99.0>, <1.0>, <1.0>, <1.0>, <0.0>, <0.0>, <1.0>, <1.0>, <0.0>]
classmethod adsr(attack_time=0.01, decay_time=0.3, sustain=0.5, release_time=1.0, peak=1.0, curve=-4.0, bias=0.0) Envelope
classmethod asr(attack_time=0.01, sustain=1.0, release_time=1.0, curve=-4.0) Envelope
classmethod from_segments(initial_amplitude=0, segments=None, release_node=None, loop_node=None, offset=None) Envelope
classmethod linen(attack_time=0.01, sustain_time=1.0, release_time=1.0, level=1.0, curve=1) Envelope
classmethod percussive(attack_time: UGenOperable | float = 0.01, release_time: UGenOperable | float = 1.0, amplitude: UGenOperable | float = 1.0, curve: EnvelopeShape | UGenOperable | float | str = -4.0) Envelope

Make a percussion envelope.

>>> from supriya.ugens import Envelope
>>> envelope = Envelope.percussive()
>>> envelope
Envelope(
    curves=(-4.0, -4.0),
    durations=(0.01, 1.0),
)
>>> list(envelope.serialize())
[<0.0>, <2.0>, <-99.0>, <-99.0>, <1.0>, <0.01>, <5.0>, <-4.0>, <0.0>, <1.0>, <5.0>, <-4.0>]
serialize(**kwargs) UGenVector
serialize_interpolated() UGenVector
classmethod triangle(duration=1.0, amplitude=1.0) Envelope

Make a triangle envelope.

>>> from supriya.ugens import Envelope
>>> envelope = Envelope.triangle()
>>> envelope
Envelope(
    durations=(0.5, 0.5),
)
>>> list(envelope.serialize())
[<0.0>, <2.0>, <-99.0>, <-99.0>, <1.0>, <0.5>, <1.0>, <0.0>, <0.0>, <0.5>, <1.0>, <0.0>]
property amplitudes : tuple[UGenOperable | float]
property curves : tuple[EnvelopeShape | UGenOperable | float]
property duration : float | UGenOperable
property durations : tuple[UGenOperable | float]
property envelope_segments
property initial_amplitude : float | UGenOperable
property loop_node : int | None
property offset : float | UGenOperable
property release_node : int | None
class Free(*, calculation_rate: CalculationRate | SupportsInt | str | None, trigger: SupportsFloat | UGenScalar = 0, node_id: SupportsFloat | UGenScalar, **kwargs)

Bases: UGen

Frees the node at node_id when triggered by trigger.

>>> node_id = 1000
>>> trigger = supriya.ugens.Impulse.kr(frequency=1.0)
>>> free = supriya.ugens.Free.kr(
...     node_id=node_id,
...     trigger=trigger,
... )
>>> free
<Free.kr()[0]>
classmethod kr(*, trigger: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 0, node_id: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property node_id : UGenScalar
property trigger : UGenScalar
class FreeSelf(*, calculation_rate: CalculationRate | SupportsInt | str | None, trigger: SupportsFloat | UGenScalar, **kwargs)

Bases: UGen

Frees the enclosing synth when triggered by trigger.

>>> trigger = supriya.ugens.Impulse.kr(frequency=1.0)
>>> free_self = supriya.ugens.FreeSelf.kr(
...     trigger=trigger,
... )
>>> free_self
<FreeSelf.kr()[0]>
classmethod kr(*, trigger: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property trigger : UGenScalar
class FreeSelfWhenDone(*, calculation_rate: CalculationRate | SupportsInt | str | None, source: SupportsFloat | UGenScalar, **kwargs)

Bases: UGen

Frees the enclosing synth when source sets its done flag.

>>> source = supriya.ugens.Line.kr()
>>> free_self_when_done = supriya.ugens.FreeSelfWhenDone.kr(
...     source=source,
... )
>>> free_self_when_done
<FreeSelfWhenDone.kr()[0]>
classmethod kr(*, source: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property source : UGenScalar
class Linen(*, calculation_rate: CalculationRate | SupportsInt | str | None, gate: SupportsFloat | UGenScalar = 1.0, attack_time: SupportsFloat | UGenScalar = 0.01, sustain_level: SupportsFloat | UGenScalar = 1.0, release_time: SupportsFloat | UGenScalar = 1.0, done_action: SupportsFloat | UGenScalar = 0, **kwargs)

Bases: UGen

A simple line generating unit generator.

>>> supriya.ugens.Linen.kr()
<Linen.kr()[0]>
classmethod kr(*, gate: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, attack_time: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 0.01, sustain_level: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, release_time: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 1.0, done_action: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]] = 0) UGenOperable
property attack_time : UGenScalar
property done_action : UGenScalar
property gate : UGenScalar
property release_time : UGenScalar
property sustain_level : UGenScalar
class Pause(*, calculation_rate: CalculationRate | SupportsInt | str | None, trigger: SupportsFloat | UGenScalar, node_id: SupportsFloat | UGenScalar, **kwargs)

Bases: UGen

Pauses the node at node_id when triggered by trigger.

>>> node_id = 1000
>>> trigger = supriya.ugens.Impulse.kr(frequency=1.0)
>>> pause = supriya.ugens.Pause.kr(
...     node_id=node_id,
...     trigger=trigger,
... )
>>> pause
<Pause.kr()[0]>
classmethod kr(*, trigger: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]], node_id: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property node_id : UGenScalar
property trigger : UGenScalar
class PauseSelf(*, calculation_rate: CalculationRate | SupportsInt | str | None, trigger: SupportsFloat | UGenScalar, **kwargs)

Bases: UGen

Pauses the enclosing synth when triggered by trigger.

>>> trigger = supriya.ugens.Impulse.kr(frequency=1.0)
>>> pause_self = supriya.ugens.PauseSelf.kr(
...     trigger=trigger,
... )
>>> pause_self
<PauseSelf.kr()[0]>
classmethod kr(*, trigger: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property trigger : UGenScalar
class PauseSelfWhenDone(*, calculation_rate: CalculationRate | SupportsInt | str | None, source: SupportsFloat | UGenScalar, **kwargs)

Bases: UGen

Pauses the enclosing synth when source sets its done flag.

>>> source = supriya.ugens.Line.kr()
>>> pause_self_when_done = supriya.ugens.PauseSelfWhenDone.kr(
...     source=source,
... )
>>> pause_self_when_done
<PauseSelfWhenDone.kr()[0]>
classmethod kr(*, source: SupportsFloat | UGenOperable | UGenSerializable | Sequence[SupportsFloat | UGenOperable | UGenSerializable | Sequence[UGenRecursiveInput]]) UGenOperable
property source : UGenScalar