Introduction to MIDI

ADVERTISEMENTS

MIDI (Musical Instrument Digital Interface) is a protocol used either to perform a direct connection between a MIDI instrument and the computer; this protocol is widely used by composers, musicians and performers as a tool. Also some instruments have the MIDI technology for playback capabilities.

MIDI is considered as a relevant tool in musical composition nowadays but years ago it was widely used on video games. Despite the lack of quality of some sound cards the MIDI format is still implemented in all computer systems.

The midi format is just a digital interpretation of digital information based on musical notation in other words the interpretation of a single note is stored in basis of properties and not sample data as other sound formats, this has the main advantage of file size storage; MIDI files are quite small compared to other sound formats like MP3 format. Other advantage is that MIDI files are easy to edit, because we can change directly the properties without using any special transformation.

MIDI Protocol provides a global standard that makes easy the implementation on several applications, the information is sent as messages that the synthesizer translates. The MIDI data is sent in an unidirectional asynchronous bit stream at 31.25 kbps using 10 bits per byte: 1 Input bit, 8 of data and one output. Within the interface used in musical instruments as keyboards, guitars, and other instruments using the MIDI protocol, the connector has three entries marked as IN, OUT and THRU where each instrument sends information in real time.

The data is received by the connector MIDI IN from the device and it’s sent in a loop through the MIDI THRU connector. Several modules of midi sound can be chained connecting the output of MIDI THRU to an input of a MIDI IN device of the next chain.

A midi message is composed of eight bit data stream, byte that is generally followed by one or two data bytes. There are different types of MIDI messages.

MIDI messages are classified as Channel Messages or System Messages.

The Channel Messages are those that are applied to a specific channel where the number of the channel is included in the status byte of these messages. System Messages are not channel specific and are not associated to channel number. The channel messages can be either classified as voice messages or mode messages. The Channel voice Messages carry musical performance data, and these messages comprise most of the traffic in a typical MIDI data stream. Channel Mode messages affect the way a receiving instrument will respond to the Channel Voice messages.

Channel voice messages are used to send musical informtion. The message in this category are:
Note On
Note Off
Key Pressure
Channel Pressure
Pitch Bend
Program Change
Control change.

MIDI System Messages are classified as:
Common System Messages
Real time messages
System exclusive Messages.
System Common Messages are used for all receivers in the system. Real Time messages are used for synchronization between MIDI systems via timer. System Exclusive Messages include the manufacturer ID code, and are used to transfer information in a format specified by the manufacturer.

MIDI Sequencers

A midi sequencer is the responsible to manage MIDI messages, can be based on software or hardware. When the sequencer receives a MIDI "note on" message it plays the appropriate sound. When the corresponding "note off "message is received, the sequencer turns the note off. When you are using an instrument as keyboard or a guitar, the sequencer can be interpreted as an event. For example if you press a key of the keyboard an Note on message is sent, if you release the key a Note off message is sent.

MIDI Files

At this point, we were talking about the MIDI protocol when is used as a MIDI instrument like a keyboard. When MIDI information is stored in a file, a time- stamping form is required for MIDI Messages.The Standard MIDI Files specification provides a standardized method for handling time-stamped MIDI data. This file format for time-stamped MIDI data allows different applications, such as sequencers, scoring packages, and multimedia software, to share MIDI data files. There are three different formats for MIDI files, the format 0 stores all data in a single track, MIDI Format 1 stores data in a collection of tracks. Format 2 files can store several independent patterns, but this format generally is not used by sequencers. Most sequencers can read Format 0 and 1. Format 1 is the most used.