       display_changed = true;
     }
 
+    // handle encoder spin
+    int16_t v = encoder->get_value();
+    if(v)
+    {
+      switch(main_selected)
+      {
+        case 0: // save
+          break;
+        case 1: // top
+          switch(top_selected)
+          {
+            case 0: // count
+              stage_count += v;
+              if(stage_count < 1)
+              {
+                stage_count = 1;
+              }
+              else if(stage_count > 8)
+              {
+                stage_count = 8;
+              }
+              seq_values.stage_count = stage_count;
+              display->fill_rect(37, 1, 7, 9, DUINO_SSD1306::White);
+              display->draw_char(38, 2, '0' + stage_count, DUINO_SSD1306::Black);
+              break;
+            case 1: // dir/add
+              if(v < 0)
+              {
+                diradd_mode = 0;
+              }
+              else if(v > 0)
+              {
+                diradd_mode = 1;
+              }
+              seq_values.diradd_mode = (bool)diradd_mode;
+              display->fill_rect(46, 1, 7, 9, DUINO_SSD1306::White);
+              display->draw_char(47, 2, diradd_mode ? 'A' : 'D', DUINO_SSD1306::Black);
+              break;
+            case 2: // slew
+              // TODO: slew
+              display->fill_rect(55, 1, 20, 9, DUINO_SSD1306::White);
+              break;
+            case 3: // gate
+              // TODO: gate
+              display->fill_rect(77, 1, 20, 9, DUINO_SSD1306::White);
+              break;
+            case 4: // clock
+              clock_bpm += v;
+              if(clock_bpm < 0)
+              {
+                clock_bpm = 0;
+              }
+              else if(clock_bpm > 30)
+              {
+                clock_bpm = 30;
+              }
+              seq_values.clock_period = bpm_to_ms(clock_bpm);
+              seq_values.clock_ext = !(bool)clock_bpm;
+              display->fill_rect(99, 1, 19, 9, DUINO_SSD1306::White);
+              display_clock(100, 2, clock_bpm, DUINO_SSD1306::Black);
+              break;
+          }
+          break;
+        case 2: // pitch
+          stage_pitch[stage_selected] += v;
+          if(stage_pitch[stage_selected] < 0)
+          {
+            stage_pitch[stage_selected] = 0;
+          }
+          else if(stage_pitch[stage_selected] > 119)
+          {
+            stage_pitch[stage_selected] = 119;
+          }
+          seq_values.stage_cv[stage_selected] = note_to_cv(stage_pitch[stage_selected]);
+          display->fill_rect(16 * stage_selected, 10, 16, 15, DUINO_SSD1306::White);
+          display_note(16 * stage_selected, 9, stage_pitch[stage_selected], DUINO_SSD1306::Black);
+          break;
+        case 3: // steps
+          stage_steps[stage_selected] += v;
+          if(stage_steps[stage_selected] < 1)
+          {
+            stage_steps[stage_selected] = 1;
+          }
+          else if(stage_steps[stage_selected] > 8)
+          {
+            stage_steps[stage_selected] = 8;
+          }
+          seq_values.stage_steps[stage_selected] = stage_steps[stage_selected];
+          display->fill_rect(16 * stage_selected, 25, 16, 17, DUINO_SSD1306::White);
+          for(uint8_t j = 0; j < stage_steps[stage_selected]; ++j)
+          {
+            display->draw_hline(16 * stage_selected + 2, 40 - j * 2, 5, DUINO_SSD1306::Black);
+            display->draw_hline(16 * stage_selected + 9, 40 - j * 2, 5, DUINO_SSD1306::Black);
+          }
+          break;
+        case 4: // gate
+          stage_gate[stage_selected] += v;
+          if(stage_gate[stage_selected] < 0)
+          {
+            stage_gate[stage_selected] = 0;
+          }
+          else if(stage_gate[stage_selected] > 5)
+          {
+            stage_gate[stage_selected] = 5;
+          }
+          seq_values.stage_gate[stage_selected] = (GateMode)stage_gate[stage_selected];
+          display->fill_rect(16 * stage_selected, 42, 16, 16, DUINO_SSD1306::White);
+          display->draw_icon_16(16 * stage_selected, 43, gate_mode_icons, (GateMode)stage_gate[stage_selected],
+              DUINO_SSD1306::Black);
+          break;
+        case 5: // slew
+          if(v < 0)
+          {
+            stage_slew |= (1 << stage_selected);
+          }
+          else if(v > 0)
+          {
+            stage_slew &= ~(1 << stage_selected);
+          }
+          seq_values.stage_slew[stage_selected] = (bool)((stage_slew >> stage_selected) & 1);
+          display->fill_rect(16 * stage_selected + 1, 59, 14, 4, DUINO_SSD1306::Black);
+          display->fill_rect(16 * stage_selected + 2 + 6 * ((stage_slew >> stage_selected) & 1), 60, 6, 2,
+              DUINO_SSD1306::White);  
+          break;
+      }
+
+      display_changed = (bool)main_selected;
+    }
+
     if(display_changed)
     {
       display->display();

    
    for(uint8_t i = 0; i < 8; ++i)
    {
      if(stage_gate[i] > 5)
      {
        stage_gate[i] = 5;
      }
      seq_values.stage_gate[i] = (GateMode)stage_gate[i];
    }

    if(stage_count < 1 || stage_count > 8)

    // verify settings and export to function parameters
    for(uint8_t i = 0; i < 8; ++i)
    {
      if(stage_pitch[i] < 0)
      {
        stage_pitch[i] = 0;
      }
      if(stage_pitch[i] > 119)
      {
        stage_pitch[i] = 119;
