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.0 / attack;
  _decaySlope = 1.0 / decay;
  _releaseSlope = 1.0 / release;
  _attackStartTime = delay;
  _holdStartTime =   delay + attack;
  _decayStartTime =  delay + attack + hold;
  _decayEndTime =    delay + attack + hold + decay;
  _releaseEndTime = release;
  _sustainLevel = sustain.clamp(0.0, 1.0);
  _releaseLevel = 0;

  _process(0);
}