Joonas Pihlajamaa has taken a Raspberry Pi and plugged in his Kawai CS-11 keyboard. By installing some software and then programming the Pi in Python, he has created a MIDI logger. He plays notes on the keyboard, the keystrokes are converted to MIDI format and then transmitted to the Pi which logs them. Take a look at how he created his MIDI logger here.