Index


Music Electronics Page

    MIDI

    The Musical Instrument Digital Interface (MIDI) enables people to use multimedia computers and electronic musical instruments together. There are actually three components to MIDI, which are the communications Protocol (language), the Connector (hardware interface) and a distribution format called Standard MIDI Files. MIDI is a way of telling a device capable of MIDI playback to play the right notes in the right order. Sort of like a digital pianola. The important bit to understand is that MIDI does not send the actual sound, only commands to make the sounds. The MIDI protocol is an entire music description language in binary form. Each word describing an action of musical performance is assigned a specific binary code. MIDI codes are like CPU machine language instructions for musical instruments. First a byte gives the instruction, if there is parameters, they follow the instruction byte using data bytes. Most typical MIDI control commands are:

    • Note off event (key, velocity)
    • Note on event (key, velocity)
    • Polyphonic key pressure (key, after-touch)
    • Control change (command address, command value)
    • Program change (program number)
    • Channel pressure (after-touch)
    • Pitch wheel change (value lsb, value msb)
    MIDI was designed for keyboards, so many of the actions are percussion oriented. To sound a note in MIDI language you send a "Note On" message, and then assign that note a "velocity", which determines how loud it plays. Other MIDI messages include selecting which instrument to play, mixing and panning sounds, and controlling various aspects of electronic musical instruments. MIDI interface is based around opto-isolated current loops. The data rate of MIDI is 31.5 kBaud. According to the MIDI 1.0 Specification, the only approved MIDI connector is a 5-pin DIN connector. It is certainly possible to send MIDI messages using other connectors and cables, but it can cause interconnection problems. A major design goal of MIDI is to prevent any ground loops that might occur with the MIDI cables. This is done by using a balanced current loop through an opto-isolator and only grounding the MIDI outputs. The MIDI IN connector is not grounded to the receiver's chassis. When done correctly, there are no ground loops and no hum or other noises caused by the MIDI setup. A PC soundcard exports the serial MIDI signal from its UART on two pins of its joystick or game port. A special cable with electronics in it converts this to the approved MIDI connector, and is supposed to include the necessary opto-isolator for conversion to the required balanced current loop (some PC MIDI cables do not do the isolation and grounfing correctly!).When MIDI messages are stored on disks, they are commonly saved in the Standard MIDI file format.The Standard MIDI File (SMF) is a file format used to store MIDI data (plus some other kinds of data typically needed by a sequencer). The purpose of MIDI Files is to provide a way of interchanging time-stamped MIDI data between different programs on the same or different computers. The format was designed to be generic so that the most important data can be read by all sequencers. The SMF format stores the standard MIDI messages (ie, status bytes with appropriate data bytes) plus a time-stamp for each message (ie, a series of bytes that represent how many clock pulses to wait before "playing" the event). The format also allows saving information about tempo, time and key signatures, the names of tracks and patterns, and other information typically needed by a sequencer. One SMF can store information for numerous patterns and tracks so that any sequencer can preserve these structures when loading the file. A track usually is analogous to one musical part, such as one instrument. A pattern would be analogous to all of the musical parts (instruments) for one song.


<webmaster@epanorama.net>

Back to ePanorama main page ??