48 inputs and 48 ouputs with arduino mega

I'd recommend an Arduino Due. It has external interrupts on all digital pins, has the same form factor as the Mega, and supports MIDI over USB natively.

Pieter