MIDI information

Technical information about MIDI - and some dubious practices to be aware of
Post Reply
superphool
Posts: 32
Joined: Sat Jul 20, 2019 7:45 pm

MIDI information

Post by superphool » Mon Aug 26, 2019 2:08 pm

MIDI stands for Musical Instrument Digital Interface.

It was created to allow different electronic musical instruments to be connected to each other in a standardised way.

Prior to MIDI, not many instruments had any kind of interconnect and the ones that did often used an analog control voltage interface called CV/Gate, which was only capable of one note at a time and often took some setting up to get any two instruments to play in the same pitch when controlled remotely.
Information on that here, for people with technical curiosity: https://en.wikipedia.org/wiki/CV/gate


The MIDI standard was released in 1983 and is a vastly more capable and powerful system than CV/Gate.

It uses "messages", which for the commonest note on or note off events, consist of three 8-bit character or byte values.
The first byte is made up of the command number and the channel that the message relates to.
The second byte is the key (note) number, in the range 0 to 127, and
The third byte is the key velocity - how fast or hard it was pressed, as a value from 0 to 127.

MIDI data is sent in a serial format (similar to RS232 or PC "COMM Port" connections, with a bit rate of 31,250 bits per second.
Each byte takes ten bits of data to send: a 0 to indicate the start of a transmission, the eight data bits, then a 1 to end the transmission.
(8N1 is RS232 terms).

That means a maximum of 3125 bytes per second or over 1000 three-byte messages per second.

Each connected MIDI device or instrument is also assigned to one of the sixteen numbered channels for sending data and can be set to listen on one or more channels for MIDI messages.

A single MIDI connection can carry messages for several different instruments, each with full polyphonic capability.


Other message types can change the patch (instrument sound) selected on an MIDI sound device, spass information on other controls such as modulation or pitch bend, send after-touch while a note is sounding if the keyboard or control source being used supports those, transfer setting or full sound files to reprogram instruments capable of that.

For more information on MIDI capabilities and messages, see the articles by Dave Marshall, here: https://users.cs.cf.ac.uk/Dave.Marshall ... de155.html


The physical MIDI connection is made commonly with five-pin 180 degree DIN plugs, with the MIDI connections being made through pins 4 & 5, plus pin 2 for the screen or ground when that is used. More compact equipment may use other types of connector with with the same electrical signals.

Note that "USB MIDI" connections are NOT! MIDI in the hardware compatible directly-connect-MIDI-to-MIDI sense.
See the separate article relating to that here: viewtopic.php?f=58&t=23


MIDI uses a "current loop" data transmission system, similar to the earlier computer "TTY" interface, however with MIDI each connector is one direction only, with a MIDI cable connecting an "out" or "through" socket on one device to an "in" on another.
The current is nominally five milliamps and flows in the idle or "1" state of the serial data connection.

At each MIDI IN connection, the two wires for the current loop usually connect to the LED in an opto-isolator via a low value resistor.
That means there is no direct electrical connection between the two devices, avoiding any ground loop effects that could cause problems with other audio connections to the same devices.

A MIDI out connection is typically driven by a transistor to the device ground with two resistors from the collector or drain and 5V power connecting that to the MIDI output or through socket.


The MIDI interface is very easy to work with and easily set up with any small microcontroller or PC such as a PIC, Arduino, Raspberry PI and suchlike.

See the article here for more information on the data format, physical connections and input / output circuits:
https://ccrma.stanford.edu/~gary/controllers/midi.html

The MIDI standards and MIDI logo are owned by the MIDI Association - their web site is here: https://www.midi.org/

Post Reply

Return to “About MIDI (read-only)”