![]() |
Deluge Firmware 1.3.0
Build date: 2026.11.28
|
#include <envelope.h>
Public Member Functions | |
| int32_t | noteOn (bool directlyToDecay, int32_t sustain, deluge::modulation::EnvelopeMode mode=deluge::modulation::EnvelopeMode::ADSR) |
| sustain is the level the smoothed sustain starts from | |
| int32_t | noteOn (uint8_t envelopeIndex, Sound *sound, Voice *voice) |
| void | noteOff (uint8_t envelopeIndex, Sound *sound, ParamManagerForTimeline *paramManager, const Voice *voice) |
| int32_t | render (uint32_t numSamples, uint32_t attack, uint32_t decay, uint32_t sustain, uint32_t release, const deluge::modulation::EnvelopeConfig &config, int32_t followInput=0) |
| void | unconditionalRelease (EnvelopeStage typeOfRelease=EnvelopeStage::RELEASE, uint32_t newFastReleaseIncrement=SOFT_CULL_INCREMENT) |
| void | unconditionalOff () |
| void | resumeAttack (float oldLastValue, const deluge::modulation::EnvelopeConfig &config) |
| void | resetTimeEntered () |
| resets time to give drone notes a lower likelihood of being culled, since they'll stay in sustain as they loop | |
Public Attributes | |
| uint32_t | pos |
| EnvelopeStage | state |
| float | lastValue |
| float | lastValuePreCurrentStage |
| uint32_t | timeEnteredState |
| bool | ignoredNoteOff |
| uint32_t | fastReleaseIncrement {1024} |
Static Public Attributes | |
| static constexpr uint32_t | kStageLength = 8388608 |
| static constexpr uint32_t | kAhdHoldSpeedup = 8 |
| AHD's hold runs this much faster than a decay stage at the same param value. | |
Private Member Functions | |
| int32_t | follow (uint32_t numSamples, uint32_t attack, uint32_t sustain, uint32_t release, const deluge::modulation::EnvelopeShape &shape, int32_t followInput) |
| void | setState (EnvelopeStage newState) |
Private Attributes | |
| float | smoothedSustain {0} |
Envelope levels are floats in [0, 1]. Stage positions stay integer: pos counts up to kStageLength at the rates the patcher gives us, and an integer accumulator is exact however slow the stage is.
| int32_t Envelope::render | ( | uint32_t | numSamples, |
| uint32_t | attack, | ||
| uint32_t | decay, | ||
| uint32_t | sustain, | ||
| uint32_t | release, | ||
| const deluge::modulation::EnvelopeConfig & | config, | ||
| int32_t | followInput = 0 ) |
Returns the level as a bipolar q31 patch source value (0 -> INT32_MIN, 1 -> INT32_MAX), or INT32_MIN when off. followInput is what MPE mode follows (see EnvelopeFollow), as a q31 patch source value; other modes ignore it.