Can a Mega send MIDI commands through its USB port?

You can't say that when Note on /off work , SYSEX and all others messages (e.g. NRPN) will work !

Yes you can, the heavy traffic is a problem for the software NOT THE SODDING HARDWARE.

The chain as usual is Software<=>firmware<=>hardware...so problems can occur at all levels. Including msg corruption due to bad or low cost components. I saw that in the past.

I bought 2 of these $5 USB midi interfaces.
Optocoupler was replaced by a basic resistor...NOT MIDI COMPLIANT
Sysex are not transmitted. NOT MIDI COMPLIANT
Random notes were generated when moving fast the pitch bend stick....
But Note on/off were transmitted !

So why not with a TOY, but not with $$$$ midi gears.

What must be retain here is to not use these pure sh.. interfaces.

TheKikGen:
@Ronart :

You can use USBMidiKlik USB midi converter with your ATmega2560 R3 if it's USB is managed by an ATMEGA8U2 (and not the CH340G).

Like this one :
NEW PRODUCT – Arduino Mega 2560 R3 (Atmega2560 – assembled) « Adafruit Industries – Makers, hackers, artists, designers and engineers!

USBMidiKlik is a dual serial CDC /midi boot loader, allowing updates of the Arduino sketch without reloading each time the Arduino standard bootloader. When you connect the specific pin to ground, the Arduino boots in serial mode.

I use on arduino UNO (made in Italy so with atmega 16U2 and Atmega 328P but buy in China for 5,40 € ... mysteres of commerce) and work all ok with your bootloader.

Thanks more TheKikGen and good sounds!!!