It is approximately 2 years ago, when I was thinking about direct connection of USB musical keyboard with sound module equipped with standard MIDI IN connector. I tried to find any solution, but no one seemed to be perfect and robust. Finally, after 2 years, I found library of Yuuichi Akagawa. His perfect library definitively works and I produced beautiful USB2MIDI box.
Thanks to Yuuichi Akagawa I could use his example code practically without any change, except additional code for LED signalling, but it is absolutely not important intervention. You can download the .ino code here:
USB2MIDI converter ino code.I built-in the USB2MIDI converter inside the box, printed by 3D printer, using these files: USB2MIDI converter stl files.
PCB was obligatelly milled by my milling machine with help of these files: USB2MIDI converter milling files.
USB2MIDI box schematics at the following picture:
with PCB layout design:
And here are photos from the inside of device.
PCB top side:
You could see one part of mandatory hardware modification - you have to cut Vbus on the USB hub mini shield, and connect this pin with +5V by wire (yellow wire on the picture, cut is from the other side of PCB).
PCB bottom side: