 // todo stuff for performance layer
 /*
 void OnNoteOn(byte channel, byte note, byte velocity)
-{
-  note = note - LOWNOTE;
-  untztrument.setLED(untztrument.xy2i(note % WIDTH, note / WIDTH));
-}
-
-void OnNoteOff(byte channel, byte note, byte velocity)
-{
-  note = note - LOWNOTE;
-  untztrument.clrLED(untztrument.xy2i(note % WIDTH, note / WIDTH));
-}
-
-void setup() {
-  pinMode(LED, OUTPUT);
-#ifndef HELLA
-  untztrument.begin(addr[0], addr[1], addr[2], addr[3]);
-#else
-  untztrument.begin(addr[0], addr[1], addr[2], addr[3],
-                    addr[4], addr[5], addr[6], addr[7]);
-#endif // HELLA
-#ifdef __AVR__
-  // Default Arduino I2C speed is 100 KHz, but the HT16K33 supports
-  // 400 KHz.  We can force this for faster read & refresh, but may
-  // break compatibility with other I2C devices...so be prepared to
-  // comment this out, or save & restore value as needed.
-  TWBR = 12;
-#endif
-  untztrument.clear();
-  untztrument.writeDisplay();
-  usbMIDI.setHandleNoteOff(OnNoteOff);
-  usbMIDI.setHandleNoteOn(OnNoteOn);
-}
-
-void loop() {
-  unsigned long t = millis();
-  if((t - prevReadTime) >= 20L) { // 20ms = min Trellis poll time
-    if(untztrument.readSwitches()) { // Button state change?
-      for(uint8_t i=0; i<N_BUTTONS; i++) { // For each button...
-        // Get column/row for button, convert to MIDI note number
-        uint8_t x, y, note;
-        untztrument.i2xy(i, &x, &y);
-        note = LOWNOTE + y * WIDTH + x;
-        if(untztrument.justPressed(i)) {
-          usbMIDI.sendNoteOn(note, 127, CHANNEL);
-          //untztrument.setLED(i);
-        } else if(untztrument.justReleased(i)) {
-          usbMIDI.sendNoteOff(note, 0, CHANNEL);
-          //untztrument.clrLED(i);
-        }
-      }
-      
-    }
-    prevReadTime = t;
-    digitalWrite(LED, ++heart & 32); // Blink = alive
-    
-    usbMIDI.read(2);
-    untztrument.writeDisplay();
-  }
-  while(); // Discard incoming MIDI messages
-}
-*/
-
-
+ {
+ note = note - LOWNOTE;
+ untztrument.setLED(untztrument.xy2i(note % WIDTH, note / WIDTH));
+ }
+ 
+ void OnNoteOff(byte channel, byte note, byte velocity)
+ {
+ note = note - LOWNOTE;
+ untztrument.clrLED(untztrument.xy2i(note % WIDTH, note / WIDTH));
+ }
+ 
+ void setup() {
+ pinMode(LED, OUTPUT);
+ #ifndef HELLA
+ untztrument.begin(addr[0], addr[1], addr[2], addr[3]);
+ #else
+ untztrument.begin(addr[0], addr[1], addr[2], addr[3],
+ addr[4], addr[5], addr[6], addr[7]);
+ #endif // HELLA
+ #ifdef __AVR__
+ // Default Arduino I2C speed is 100 KHz, but the HT16K33 supports
+ // 400 KHz.  We can force this for faster read & refresh, but may
+ // break compatibility with other I2C devices...so be prepared to
+ // comment this out, or save & restore value as needed.
+ TWBR = 12;
+ #endif
+ untztrument.clear();
+ untztrument.writeDisplay();
+ usbMIDI.setHandleNoteOff(OnNoteOff);
+ usbMIDI.setHandleNoteOn(OnNoteOn);
+ }
+ 
+ void loop() {
+ unsigned long t = millis();
+ if((t - prevReadTime) >= 20L) { // 20ms = min Trellis poll time
+ if(untztrument.readSwitches()) { // Button state change?
+ for(uint8_t i=0; i<N_BUTTONS; i++) { // For each button...
+ // Get column/row for button, convert to MIDI note number
+ uint8_t x, y, note;
+ untztrument.i2xy(i, &x, &y);
+ note = LOWNOTE + y * WIDTH + x;
+ if(untztrument.justPressed(i)) {
+ usbMIDI.sendNoteOn(note, 127, CHANNEL);
+ //untztrument.setLED(i);
+ } else if(untztrument.justReleased(i)) {
+ usbMIDI.sendNoteOff(note, 0, CHANNEL);
+ //untztrument.clrLED(i);
+ }
+ }
+ 
+ }
+ prevReadTime = t;
+ digitalWrite(LED, ++heart & 32); // Blink = alive
+ 
+ usbMIDI.read(2);
+ untztrument.writeDisplay();
+ }
+ while(); // Discard incoming MIDI messages
+ }
+ */
+
+
+
+

 0,2,4,5,6,7,10};
 
 uint8_t notes[MAX_MIDI_NOTES];

 void makenotes(uint8_t * scale, uint8_t length)
 {
 for (int index = 0; index < MAX_MIDI_NOTES/2; index++)

  memset(grid_width, 16, sizeof(grid_width)); // default all grids to 16 beats wide
  memset(scale_notes, 0, sizeof(scale_notes)); // default all grids to major scale
  memset(channels, 2, sizeof(channels)); // default all channels to 2

  for (uint8_t index = 0; index < GRID_SETS; index++) // default all the last layers to channel 10 for mt32 drum channel
  {
    channels[LAYERS-2][index] = 10;
  }

  //  load();

  eScaleOffset.setBounds(0, 44 * 4 + 3); // Set note offset limits
  eScaleOffset.setValue(noteOffset[layer][visible_grid_set] * 4);              // *4's for encoder detents
