Midi Controller for Line 6 m5 with Arduino Due

you could use the techniques described here

Errr, I don't like that.

I tested the first code without the library on a Due and it works fine.
I was concerned that the Due could not handle that odd baud rate but it is fine. Attached is an image of the output, I actually shortened the first delay to get both messages on the same screen, but as you can see the data is transmitted perfectly.

Therefore it is your MIDI interface that is wrong. Note you can use one of the other three serial outputs on the Due as well.