MIDI Keyboard Encoder - Arduino Piano/Keyboard (question)

I built a MIDI controller with an old organ keyboard, an Arduino and two hc595 shift registers. It is documented in my blog (it's written in french, but maybe the sketch and schematics will be of some help?)

Scanning the keyboard and displaying the result on the serial monitor:

And then sending out MIDI messages: