Home Learn About MIDI About US Specifications Career Center Public Forum Store
Tutorials Resources Fun With MIDI MIDI Products Glossary


Tutorial: The Technology of MIDI

Part 4: MIDI Files

Overview
MIDI Cables & Connectors
MIDI Messages


Standard MIDI Files ("SMF" or *.mid files) are a popular source of music on the web, and for musicians performing in clubs who need a little extra accompaniment. The files contain all the MIDI instructions for notes, volumes, sounds, and even effects. The files are loaded into some form of ‘player' (software or hardware), and the final sound is then produced by a sound-engine that is connected to or that forms part of the player. 

One reason for the popularity of MIDI files is that, unlike digital audio files (.wav, .aiff, etc.) or even compact discs or cassettes, a MIDI file does not need to capture and store actual sounds. Instead, the MIDI file can be just a list of events which describe the specific steps that a soundcard or other playback device must take to generate ceratin sounds. This way, MIDI files are very much smaller than digital audio files, and the events are also editable, allowing the music to be rearranged, edited, even composed interactively, if desired.

All popular computer platforms can play MIDI files (*.mid) and there are thousands of web sites offering files for sale or even for free. Anyone can make a MIDI file using commercial (or free) software that is readily available, and many people do, with a wide variety of results.

Whether or not you like a specific MIDI file can depend on how well it was created, and how accurately your synthesizer plays the file... not all synthesizers are the same, and unless yours is similar to that of the file composer, what you hear may not be at all what he or she intended. General MIDI (GM) and Downloadable Sounds (DLS) both help address the issue of predictable playback from MIDI Files.

When coupled with a Downloadable Sounds (DLS) synthesizer, MIDI files can be combined with standardized samples of musical instruments, sound effects, or even dialogue, which are used to recreate an exact copy of the sound intended by the composer. MIDI files with DLS (in RMID or XMF format) are the ideal solution for composers of all kinds who want the predictable playback of digital audio, but also need the compactness and/or interactivity of Standard MIDI Files for delivering their music.

Formats

The Standard MIDI File format is different from native MIDI protocol, because the events are time-stamped for playback in the proper sequence. 

Standard MIDI Files come in two basic varieties: a Type 1 file, and a Type 0 file (a Type 2 was also specified originally but never really caught on, so we won't spend any time discussing it here). In a Type 1 file individual parts are saved on different tracks within the sequence. In a Type 0 file everything is merged onto a single track. 

Making SMFs

Musical performances are not usually created as SMFs; rather a composition is recorded using a sequencer such as Digital Performer, Cubase, Sonar etc. that saves MIDI data in it's own format. However, most if not all sequencers an ‘Save As' or ‘Export' as a Standard MIDI File.

Compositions in SMF format can be played using most media players such as Windows Media Player™ (WMP) on a PC and QuickTime™ on a Mac. QuickTime™ will automatically convert a SMF into a QuickTime movie. Both WMP and QuickTime™ assumes a SMF will be scored for GM in terms of drums on MIDI Channel 10, Program Changes etc.

SMFs on Macs

The PC file extension for an SMF is .MID. Macs do not generally require to ‘see' the .MID extension in order for the file to be utilized but PC-based applications generally do. If a Mac-created SMF is to be loaded into a PC-based application and does not have its .MID extension you may well be able to simply type in the extension after the file name in order for it to be recognized!

Setup Data

An SMF not only contains regular MIDI performance data – Channelized notes, lengths, pitch bend data etc – it also should have data (commonly referred to as a ‘header') that contains additional set-up data (tempo, instrument selections per Channel, controller settings, etc.) as well as song  information (copyright notices, composer, etc.).

How good, or true to its originally created state an SMF will sound can depend a lot on the header information. The header can exert control over the mix, effects, and even sound editing parameters in order to minimize inherent differences between one soundset and another. There is no standard set of data that you have to put in a header (indeed such data can also be placed in a spare ‘set-up' bar in the body of the file itself) but generally speaking the more information you provide for the receiving sound device the more defined – and so, presumably, the more to your tastes – the results will be.

Depending upon the application you are using to create the file in the first place, header information may automatically be saved from within parameters set in the application, or may need to be manually placed in a ‘set-up' bar before the music data commences.

Information that should be considered (per MIDI Channel) includes:

  • Bank Select (0=GM) / Program Change #
  • Reset All Controllers (not all devices may recognize this command so you may prefer to zero out or reset individual controllers)
  • Initial Volume (CC7) (standard level = 100)
  • Expression (CC11) (initial level set to 127)
  • Hold pedal (0 = off)
  • Pan (Center = 64)
  • Modulation (0)
  • Pitch bend range
  • Reverb (0 = off)
  • Chorus level (0 = off)

All files should also begin with a GM/GS/XG Reset message (if appropriate) and any other System Exclusive data that might be necessary to setup the target synthesizer. If RPNs or more detailed controller messages are being employed in the file these should also be reset or normalized in the header.

If you are inputting header data yourself it is advisable not to clump all such information together but rather space it out in intervals of 5-10 ticks. Certainly if a file is designed to be looped, having too much data play simultaneously will cause most playback devices to ‘choke, ' and throw off your timing.

All materials, graphics, and text copyright © 1995-2014 MIDI Manufacturers Association Incorporated.
Use is prohibited without written permission.