I am currently working on a MIDI controller and would like to be able to output MIDI messages both over USB to interface with modern DAWs, and also be able to output using a MIDI jack so that I can interface with some funky retro synths.
I am currently in the process of porting my code from an arduino mega to a teensy3.5 due to the improved performance and lessened size.
I have been able to get the looping note sketch to work on the teensy (my full project is a lot more complex so I didn't want to start modifying all that code until I had gotten this working) https://www.pjrc.com/teensy/td_libs_MIDI.html
I think there are two separate libraries available through arduino's library manager, one is supposed to handle USB midi and one is supposed to handle hardware MIDI but they seem to have the same name? Simply MIDI.h (Not sure about this bit).
The reason I say this is because I was previously using this project
to handle the MIDI comms over USB on the ardiuno mega, Long story short, it is a custom firmware for the MEGA's 16u2 chip which interprets serial data and outputs midi over usb. HOWEVER, when I try to run the noteloop sketch on the teensy using the EXACT same header name when declared, MIDI.H, I have to call functions using usbMIDI.functionName() whereas before it was simply MIDI.functionName().