     {
       stage_count = 8;
     }
-
     seq_values.stage_count = stage_count;
+
     seq_values.diradd_mode = (bool)diradd_mode;
-    seq_values.slew_rate = (float)slew_rate / 255.0;
-    seq_values.gate_time = (float)gate_time / 255.0;
+    
+    if(slew_rate < 0 || slew_rate > 16)
+    {
+      slew_rate = 8;
+    }
+    seq_values.slew_rate = (float)slew_rate / 16.0;
+
+    if(gate_time < 0 || gate_time > 16)
+    {
+      gate_time = 8;
+    }
+    seq_values.gate_time = (float)gate_time / 16.0;
     
     if(clock_bpm < 0 || clock_bpm > 30)
     {

      display->draw_hline(57 + i * 22, 8, 16, DUINO_SSD1306::White);
      display->draw_vline(73 + i * 22, 2, 7, DUINO_SSD1306::White);
    }
    display_clock(100, 2, clock_bpm, DUINO_SSD1306::White);

    // draw step elements

    else if(b == DUINO_Encoder::Clicked)
    {
      // switch local selection
      switch(main_selected)
      {
        case 0: // save
          save_params(0, stage_pitch, 8);
          save_params(8, stage_steps, 8);
          save_params(16, stage_gate, 8);
          save_params(24, &stage_slew, 1);
          save_params(25, (uint8_t *)&stage_count, 1);
          save_params(26, &diradd_mode, 1);
          save_params(27, (uint8_t *)&slew_rate, 1);
          save_params(28, (uint8_t *)&gate_time, 1);
          save_params(29, (uint8_t *)&clock_bpm, 1);
          display->fill_rect(123, 2, 3, 3, DUINO_SSD1306::Black);
          break;
        case 1: // top
          invert_current_selection();
          top_selected++;
          top_selected %= 5;
          invert_current_selection();
          break;
        default: // stages
          invert_current_selection();
          stage_selected++;
          stage_selected %= 8;
          invert_current_selection();
          break;
      }
      display_changed = true;
    }

