MIDI Device Protocol
Sparkfun's MIDI Tutorial is fantastic, and likely has most if not all of
the information you would need to go from no knowledge what so ever on the
topic to communicating directly with MIDI devices with your trusty arduino
and some sketchy soldering.
RtMidi is a C++ library which provides a common interface for accessing MIDI devices
using a variety of audio backends on Mac, Windows, and Linux. This does not provide
much abstraction over the MIDI protocol itself, so take some time to scan through
the Sparkfun Tutorial first if you are unfamiliar with it.
MIDI devices use UART for the actual hardware interface. The article's
explanation of UART data framing is useful if you plan on bit banging your UART.
This project is a simple implementation of UART in VHDL, and is suitable
for communicating with MIDI devices.
Disclaimer: I have no idea what I'm doing. But, I put together a VHDL thing
that sits on top of the previously mentioned VHDL UART thing, and my thing
takes the incoming bits and bops and spits out nice neatly organized signals
that would be useful for building an instrument out of.
Scans From my Notebook
For the brave, here are some pages from my notebook that outline the
basic anatomy of a MIDI packet.