   {
     if (adjust<int8_t>(widget_save_->params.vals.gate_time, delta, 0, GATE_TIME_MAX))
     {
-      gate_ms = widget_save_->params.vals.gate_time * (uint16_t)(Clock.get_period() / GATE_TIME_DIV);
+      gate_ms_ = widget_save_->params.vals.gate_time * (uint16_t)(Clock.get_period() / GATE_TIME_DIV);
       widget_save_->mark_changed();
       widget_save_->display();
       Display.fill_rect(widget_gate_->x() + 2, widget_gate_->y() + 2, 16, 5, DUINO_SH1106::White);

      gt_out(GT2, false);

      // update step clock time
      clock_time = millis();
    }

    // set gate state
    switch ((GateMode)(widget_save_->params.vals.stage_gate[cached_stage]))
    {
      case GATE_NONE:
        gate = false;
        break;
      case GATE_1SHT:
        if (!cached_step)
        {
          gate = partial_gate();
        }
        break;
      case GATE_REPT:
        gate = partial_gate();
        break;
      case GATE_LONG:
        if (cached_step == widget_save_->params.vals.stage_steps[cached_stage] - 1)
        {
          gate = partial_gate();
        }
        else
        {
          gate = true;
        }
        break;
      case GATE_EXT1:
        gate = gt_read(CI3);
        break;
      case GATE_EXT2:
        gate = gt_read(CI4);
        break;
    }

    // set pitch CV state
    const float pitch_cv = note_to_cv(widget_save_->params.vals.stage_pitch[cached_stage]);
    const bool slew_on = (bool)((widget_save_->params.vals.stage_slew >> cached_stage) & 1);
    cv_out(CO1, slew_on ? slew_filter->filter(pitch_cv) : pitch_cv);

    // set gate and clock states
    gt_out(GT1, gate);
    gt_out(GT2, cached_clock_gate);

    // update reverse setting
    if (!widget_save_->params.vals.diradd_mode)
    {
      reverse = gt_read(CI1);
    }

    // update half clock setting

  virtual void function_loop()
  {
    // cache stage, step, and clock gate (so that each loop is "atomic")
    const uint8_t cached_stage = stage_;
    const uint8_t cached_step = step_;
    cached_clock_gate_ = Clock.state();
    cached_retrigger_ = Clock.retrigger();

    if (cached_retrigger_)
    {
      // drop gate at start of stage
      if (!cached_step)
