Interpreting MIDI input... seems off

You have a timing mismatch between data coming in and data going on. MIDI data is arriving at 31250 bps, but you are printing out, as soon as a character is received, at 9600 bps. So it takes longer for you to print data to the screen than it does to arrive from your keyboard. This means you might be missing data coming from the keyboard.

Also note that SoftwareSerial has never had a good history of working well on a Mega. The Mega has several hardware serial ports, why not use one of them?

--
The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins