psychos.sound.LinearDecayEnvelope#

class psychos.sound.LinearDecayEnvelope(peak=1.0)[source]#

Bases: Envelope

A linearly decaying envelope.

This envelope linearly decays the amplitude from the peak value to 0, over the length of the waveform.

Parameters:
peakfloat

The Initial peak value of the envelope, from 0.0 to 1.0. Values outside this range will be clamped.

__init__(peak=1.0)[source]#

Methods

__init__([peak])

get_generator(sample_rate, duration)

Get a generator instance.

get_generator(sample_rate: float, duration: float) Generator[float][source]#

Get a generator instance.

Parameters:
  • sample_rate – The sample rate of the Source this will be applied to.

  • duration – The duration of the Source. This is used to calculate the number of bytes for some Envelopes.