   {
     if (retrigger_)
     {
+      // update the currently selected envelope (we use the same envelope for the duration of a curve)
       env_ = selected_env_;
+
+      // reset the gate and release times so that the curve logic can execute
       gate_time_ = 0;
       release_time_ = 0;
+
+      // reset to wait for another retrigger
       retrigger_ = false;
     }
 

        }
        else
        {
          // decay/sustain
          cv_current_ = adsr_values_[env_].S + (ENV_PEAK - adsr_values_[env_].S)
              * exp(ENV_DECAY_COEFF * (float(elapsed - adsr_values_[env_].A) / float(adsr_values_[env_].D)));
        }

    {
      if (gate_)
      {
        // if the gate is active, we are in the attack, decay, or sustain part of the curve, depending on elapsed time
        uint16_t elapsed = millis() - gate_time_;
        if (elapsed < adsr_values_[env_].A)
        {
