     prevReadTime = t;
     digitalWrite(LED, ++heart & 32); // Blink = alive
   }
-  while(usbMIDI.read()); // Discard incoming MIDI messages
 }
-
-/* Here's the set of MIDI functions for making your own projects:
-
-  usbMIDI.sendNoteOn(note, velocity, channel)
-  usbMIDI.sendNoteOff(note, velocity, channel)
-  usbMIDI.sendPolyPressure(note, pressure, channel)
-  usbMIDI.sendControlChange(control, value, channel)
-  usbMIDI.sendProgramChange(program, channel)
-  usbMIDI.sendAfterTouch(pressure, channel)
-  usbMIDI.sendPitchBend(value, channel)
-  usbMIDI.sendSysEx(length, array)
-  usbMIDI.send_now()
-
-  Some info on MIDI note numbers can be found here:
-  http://www.phys.unsw.edu.au/jw/notes.html
-
-  Rather than MIDI, one could theoretically try using Serial to
-  create a sketch compatible with serialosc or monomeserial, but
-  those tools have proven notoriously unreliable thus far. */

#include <Wire.h>
#include <Adafruit_Trellis.h>
#include <Adafruit_UNTZtrument.h>

#define LED     13 // Pin for heartbeat LED (shows code is working)
#define CHANNEL 1  // MIDI channel number

        untztrument.i2xy(i, &x, &y);
        note = LOWNOTE + y * WIDTH + x;
        if(untztrument.justPressed(i)) {
          noteOn(CHANNEL, note, 127);
          untztrument.setLED(i);
        } else if(untztrument.justReleased(i)) {
          noteOff(CHANNEL, note, 0);
          untztrument.clrLED(i);
        }
      }
