psychos.sound.TremoloEnvelope#

class psychos.sound.TremoloEnvelope(depth: float, rate: float, amplitude: float = 0.5)[source]#

Bases: Envelope

A tremolo envelope, for modulation amplitude.

A tremolo envelope that modulates the amplitude of the waveform with a sinusoidal pattern. The depth and rate of modulation can be specified. Depth is calculated as a percentage of the maximum amplitude. For example: a depth of 0.2 and amplitude of 0.5 will fluctuate the amplitude between 0.4 an 0.5.

Parameters:
  • depth – The amount of fluctuation, from 0.0 to 1.0.

  • rate – The fluctuation frequency, in seconds.

  • amplitude – The peak amplitude (volume), from 0.0 to 1.0.

__init__(depth: float, rate: float, amplitude: float = 0.5)[source]#

Methods

__init__(depth, rate[, amplitude])

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.