   if((t - prevBeatTime) >= beatInterval) { // Next beat?
     // Turn off old column
     line(col, false);
+    mask = pgm_read_byte(&bitmask[col]);
     for(uint8_t row=0; row<8; row++) {
-      if(grid[col][row]) {
+      if(grid[row] & mask) {
         usbMIDI.sendNoteOff(pgm_read_byte(&note[row]), 127,
           pgm_read_byte(&channel[row]));
       }

    { 17, 21, 25, 29, 49, 53, 57, 61 },
    { 18, 22, 26, 30, 50, 54, 58, 62 },
    { 19, 23, 27, 31, 51, 55, 59, 63 } },
  note[8]    = { 72, 71, 69, 67, 65, 64, 62, 60 },
  channel[8] = {  1,  1,  1,  1,  1,  1,  1,  1 };

void setup() {
  pinMode(LED, OUTPUT);

        uint8_t xy = pgm_read_byte(&i2xy[i]),
                x  = xy >> 4,
                y  = xy & 0x0F;
        mask = pgm_read_byte(&bitmask[x]);
        if(trellis.justPressed(i)) {
          if(grid[y] & mask) { // Already set?  Turn off...
            grid[y] &= ~mask;
            trellis.clrLED(i);
            usbMIDI.sendNoteOff(pgm_read_byte(&note[y]),
              127, pgm_read_byte(&channel[y]));
          } else {         // Turn on
            grid[y] |= mask;
            trellis.setLED(i);
          }
          refresh = true;
