scisonify.core.envelope.EnvelopeADSR
- class scisonify.core.envelope.EnvelopeADSR(attack_length=0.2, decay_length=0.1, release_length=0.2, note_length=1.0, start_amplitude=0.0, sustian_amplitude=0.8)
Attack-Decay-Sustain-Release Envelope Implementation, adapted from the C++ implementation by javidx9 (https://www.youtube.com/watch?v=OSCzKOqtgcA)
Parameters
- attack_length: optional, float
Duration of “attack”
- decay_length: optional, float
Duration of “decay”
- release_length: optional, float
Duration of “release”
- note_length: optional, float
The total length of a note
- start_amplitude: optional, float
Initial amplitude for a note
- sustian_amplitude: optional, float
Sustain amplitude for a note
- __init__(attack_length=0.2, decay_length=0.1, release_length=0.2, note_length=1.0, start_amplitude=0.0, sustian_amplitude=0.8)
Methods
__init__([attack_length, decay_length, ...])get_amplitude(time)Returns the envelope amplitude at a given time step
get_amplitudes(times)Returns all the amplitudes for an array of discrete times.