The original MIDI protocol ran over a serial UART framed bit stream, at 31.25 KHz. The data connection is one way, and optically isolated at the receiving end. The connector used is a 5 pin DIN connector. Now the MIDI protcol can be carried over the USB bus, or even Ethernet.
MIDI on WikipediaThe MIDI byte protocol, starts out simple, but can get very involved as more features are used. The first byte is the command, with upper nibble basic function like note on/off. The lower nibble is the channel number, of which there are 16 possible channels.
List of byte sequence in the MIDI stream
Here is a simple example of Arduino code to accept MIDI commands and send output to Audio. In the Arduino IDE, look under the files menu for Examples, and scroll down to the MIDI code examples.
MIDI with Arduino