From Video Game Music Preservation Foundation Wiki
Revision as of 08:02, 5 September 2022 by Жукороп (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Extended Multiple Instrument Digital Interface
Developer: John Miles
Header: IFF
Content: Notational
Instruments: External
Target Output
Output - Digital Audio - No.png Output - MIDI.png Output - FM Synthesis.png Output - PSG.png
Released: 1991-??-??
  • *.xmi

Extended Multiple Instrument Digital Interface (XMI) is a MIDI-like format that was created by John Miles originally for use with the Audio Interface Library (later called the Miles Sound System), an audio driver and software API he developed and released in 1991. The format and its library became very popular among DOS games in the 1990s, but fell out of favor in the late 1990s as computing power increased to allow for PCM music.

Like MIDI, XMI files store only the notes of the song. Instrument definitions and hardware specific instructions must be handled externally, a problem that required most game developers of the time to have to write their own audio drivers for every target device. The Miles Sound System addressed this problem by including a wide variety of audio drivers for all the popular sound cards of the day. The drivers could even be customized by developers. This allowed composers the freedom of MIDI's write once, play everywhere mentality without being limited to MIDI compatible devices.

XMI also offers extra channel support over MIDI, internal looping, compression, and can store up to 10 songs in a single file.







XMI to ?

? to XMI



These are 20 of the more popular games that use XMI, for the complete list, view the category.

Released Title Sample
1992-03-?? Ultima Underworld: The Stygian Abyss (DOS)
1992-04-16 Ultima VII: The Black Gate (DOS)
1992-05-?? The Legend of Kyrandia: Book One (DOS)
1992-12-?? Dune II: The Building of a Dynasty (DOS)
1992-??-?? Eye of the Beholder III: Assault on Myth Drannor (DOS)
1992-??-?? Battle Chess 4000 (DOS)
1992-??-?? The Dark Queen of Krynn (DOS)
1992-??-?? Tetris Classic (DOS)
1993-??-?? Dungeon Hack (DOS)
1993-??-?? The Legend of Kyrandia: Book Two - Hand of Fate (DOS)
1993-??-?? The Seven Cities of Gold (DOS)
1993-??-?? SimCity 2000 (DOS)
1993-??-?? SimFarm (DOS)
1993-??-?? Wayne's World (DOS)
1994-11-19 U.S. Navy Fighters (DOS)
1995-??-?? Hi Octane (DOS)
1995-??-?? Shannara (DOS)
1996-03-31 ATF: Advanced Tactical Fighters (DOS)
1996-11-30 Rex Blade: The Battle Begins (DOS)
1997-??-?? Theme Hospital (DOS)

How to Obtain

XMI files usually need to be extracted from game resource files, a process that is different for nearly every game that uses the format.


The XMI format is an IFF variant used to contain MIDI events. The top-level chunk is always FORM. This is followed by an XDIRINFO chunk containing the amount of subsongs contained, written as a 16-bit little-endian integer. After that comes a CAT  chunk which contains the collection of subsongs as a series of XMIDFORM, XMIDEVNT, XMIDTIMB, and EVNT chunks. All XMI files end with hex values "FF 2F" followed by one or two nulls.

XMI files play MIDI at a fixed clock rate of 120 Hz. To play them correctly, the Tempo and PPQN division values used for playback should therefore also yield a constant 120 Hz, for example a tempo of 500 000 microseconds and a PPQN of 60, or a tempo of 1 000 000 microseconds and a PPQN of 120. Tempo events contained in the EVNT chunks should be ignored; they are vestigial remnants of the original MIDI file converted into the XMI format and do not correspond to the values used by the converted event stream.

All XMI files use IFF tree structure, and the identifiers are XDIR and XMID.

IFF Tree Structure

File Root
├─ FORM:XDIR     - IFF header
│  └─ INFO       - Info chunk
└─ CAT :XMID     - IFF subheader (catalog)
   ├─ FORM:XMID  - Subsong #1
   │  ├─ TIMB    - Timbre chunk (optional)
   │  └─ EVNT    - MIDI events chunk
   ├─ FORM:XMID  - Subsong #2
   │  └─ ...
   └─ ...