start method

void start({
  1. required double delay,
  2. required double attack,
  3. required double hold,
  4. required double decay,
  5. required double sustain,
  6. required double release,
})

Implementation

void start({required double delay,
            required double attack,
            required double hold,
            required double decay,
            required double sustain,
            required double release})
{
    _attackSlope = 1 / attack;
    _decaySlope = -9.226 / decay;
    _releaseSlope = -9.226 / release;
    _attackStartTime = delay;
    _holdStartTime = delay + attack;
    _decayStartTime = delay + attack + hold;
    _releaseStartTime = 0;
    _sustainLevel = sustain.clamp(0.0, 1.0);
    _releaseLevel = 0;
    _processedSampleCount = 0;
    _stage = EnvelopeStage.delay;
    _value = 0;

    _process(0);
}