Arduino + Adafruit NeoPixel NeoMatrix - bluetooth MIDI Hat



Inspired by my Christmas Tree with IP address and wanting to perfect lights syncing with a MIDI keyboard - I decided a wearable Christmas project would be good for 2015. Most Christmas hats don't have enough lights but I thought 128 individually addressable RGB LEDs - provided by two Adafruit NeoPicel NeoMatrix (8x8) should be sufficient.

The Hat needed a micro-controller for which I chose the Adafruit Flora, a Bluefruit EZ link for bluetooth communication and a 6Ah LiPo battery - which was actually a bit heavy!.

The keyboard connects to an Arduino Mega Serial Receive pin which parses MIDI data and sends useful messages to the hat via a bluetooth shield. The Arduino Mega also acts as a midi thru and sends unaltered midi data to my Sonic Cell sound module. the code on the Arduino does a much better job this year of handling Running Status and other MIDI events such as Controller Change messages (eg sustain pedal).

The LEDs on the hat represent keys on a piano - each octave is two LEDs high (white notes are 2 LEDs high, black notes are 1 LED high). The LEDs combined represent 4 octaves. Towards the bottom left is the C (two octaves below Middle C), moving to the right each LED represents a note - there are 12 LEDs in an octave - from C on the left, chromatically up to B on the right.

The colour of each note is randomly generated - brightness affected by the velocity of the key press. Notes played within 50ms of the previous note (ie chords) share the same colour. When a key is held (or sustained with the damper pedal), the colour gradually fades.