MIDI input works but not for all MIDI signals

Now the other factors come into play. The MMA does not specify an optoisolator but its CTR (current transfer ratio) can be important. Your TLP521-1 has (in its least expensive rating) a 50% CTR. You may need to find one with a higher CTR. For example, an Avago 4N35-000E has a 100% CTR and will probably do much better.

You can test this theory by (temporarily) lowering the 220ohm resistor on the input side (could be dangerous if what's driving it can't handle the current), or driving the input side yourself with a controlled voltage source to see at what input current level the output starts looking nice again.

--
The QuadRAM shield: add 512 kilobytes of external RAM to your Arduino Mega/Mega2560