Arduino MIDI Controller

Hello, I am trying to build a midi controller with an Arduino. I would like to have 16 buttons that triggered a midi event when they were pushed. I would also like to have the buttons lit with an white LED all of the time, then change to blue when they are pushed.

I know that I will need to use shift registers, such as the CD4021BE, for the buttons, and another set of shift registers, such as the 74HC595 to control the leds.

I have read the ShiftIn and ShiftOut tutorials: and, as well as how to interface with MIDI -

I have a basic understanding of how each system would work, and how to wire them up, but I have no idea how to write a program that would combine all of them into a finished product.

Thanks for the help.

Not quite what you are after but my project is quite close and might give you some ideas, complete with code to download:-

I'm working on something similar at the moment but with analogue controls as well. (I found some nice mimi joysticks pots with push button action on ebay which inspired me to have a crack at an Eigenharp type controller.) I've taken this code and added code for note events.

I'm not to keen on the complexity of multiplexing so I'm looking at getting a mega, which should have more than enough inputs (and seems to be cheap enough these days). Alternatively, since the software supports midi-thru I'm thinking of just stringing two or three Arduinos in series.