Introduction
XM is the module format of FastTracker 2, a tracker for MS-DOS made by the group Triton. It extends the Amiga MOD idea with up to 32 channels, instruments that hold several samples across the keyboard, volume and panning envelopes, 16-bit samples and patterns of any length up to 256 rows.
XM was one of the main formats of the PC demo and tracker music scene, and modern trackers and players still read and write it.
Structure
An XM file starts with the text Extended Module: , the module name, the
byte 1A, the tracker name and a version number, usually
0x0104. A header follows, whose size is stored first, with the song length,
restart position, channel count, pattern count, instrument count, flags, default tempo
and BPM, and a 256-byte pattern order table. Numbers are little-endian.
Each pattern has its own header (length, packing type, row count and packed data size) and then its notes. The notes are packed: a byte with its top bit set says which of the five fields (note, instrument, volume column, effect, effect parameter) follow, so empty cells take one byte. Instruments come last. Each has a header with its name and sample count, a keyboard map and envelopes, then its sample headers and sample data. Sample data is stored as differences between neighbouring values, which compresses well.
0ID text Extended Module:, name, 1A, tracker name, version60 bytes60Header size, counts, flags, tempo, order table276 bytes usually…Patterns pattern header, then packed notesrepeated…Instruments header, keyboard map, envelopes, samplesrepeated
Links
Software
- OpenMPT – free tracker that plays, edits and saves XM modules (Windows)
- FastTracker 2 clone – faithful remake of FastTracker 2, the tracker XM comes from (Windows, macOS, Linux)
- XMPlay – small audio player with strong tracker module support (Windows)
- VLC media player – free player for almost any audio or video file, modules included (Windows, macOS, Linux, mobile)
Developers
- libopenmpt – module playback library from OpenMPT (C, C++)
- libxmp – module player library for XM, MOD, S3M, IT and more (C)