       {
         v[i] = V_MAX;
       }
-    }
-    v_last[0] = v[0];
-    v_last[1] = v[1];
-    v_last[2] = v[2];
-    v_last[3] = v[3]; 
-    adsr_values.A = uint16_t(v[0]) * 24;
-    adsr_values.D = uint16_t(v[1]) * 24;
-    adsr_values.S = (float(v[2]) / float(V_MAX)) * ENV_PEAK;
-    adsr_values.R = uint16_t(v[3]) * 24;
+      v_last[i] = v[i];
+    }
+    for(uint8_t e = 0; e < 8; ++e)
+    {
+      adsr_values[e].A = uint16_t(v[2 * e]) * 24;
+      adsr_values[e].D = uint16_t(v[2 * e + 1]) * 24;
+      adsr_values[e].S = (float(v[2 * e + 2]) / float(V_MAX)) * ENV_PEAK;
+      adsr_values[e].R = uint16_t(v[2 * e + 3]) * 24;
+    }
 
     // draw title
     display->draw_du_logo_sm(0, 0, DUINO_SSD1306::White);

    // draw save box
    display->fill_rect(122, 1, 5, 5, DUINO_SSD1306::White);

    // draw sliders
    for(uint8_t i = 0; i < 4; ++i)
    {
      display->fill_rect(32 * i + 11, 51 - v[i], 9, 3, DUINO_SSD1306::White);
    }

    // draw labels
    display->fill_rect(11, 55, 9, 9, DUINO_SSD1306::White);
    display->draw_char(13, 56, label[0], DUINO_SSD1306::Black);
    for(uint8_t i = 1; i < 4; ++i)
    {
      display->draw_char(32 * i + 13, 56, label[i], DUINO_SSD1306::White);
    }

    display->display_all();
  }


#define V_MAX                 43

#define DEBOUNCE_MS           100 // ms

struct DU_ADSR_Values {
  uint16_t A;  // ms
  uint16_t D;  // ms
