An IT file starts with a 192-byte header, followed by the order list, three tables of
offsets and optional blocks. All numbers are little-endian. Offsets on this page are in
hexadecimal. The structure is defined in ITTECH.TXT, the technical notes
that come with Impulse Tracker; later additions noted here come from OpenMPT’s
documentation of the format.
Layout
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 00 | 4 | ASCII | magic | IMPM. |
| 04 | 26 | text | song name | Up to 26 bytes, terminated by a zero byte. |
| 1E | 2 | u8 × 2 | PHiLight | Pattern row highlight: minor and major. Editor information only; read when Special bit 2 is set. |
| 20 | 2 | u16 | OrdNum | Number of entries in the order list. |
| 22 | 2 | u16 | InsNum | Number of instruments. |
| 24 | 2 | u16 | SmpNum | Number of samples. |
| 26 | 2 | u16 | PatNum | Number of patterns. |
| 28 | 2 | u16 | Cwt/v | The tracker and version that created the file. |
| 2A | 2 | u16 | Cmwt | The earliest format version that can read the file. |
| 2C | 2 | u16 | Flags | Song options. |
| 2E | 2 | u16 | Special | Which optional parts are present. |
| 30 | 1 | u8 | GV | Global volume, 0 to 128. |
| 31 | 1 | u8 | MV | Mix volume, 0 to 128. |
| 32 | 1 | u8 | IS | Initial speed: ticks per row. |
| 33 | 1 | u8 | IT | Initial tempo. |
| 34 | 1 | u8 | Sep | Stereo separation, 0 to 128. |
| 35 | 1 | u8 | PWD | Pitch wheel depth for MIDI controllers. |
| 36 | 2 | u16 | MsgLgth | Length of the song message. |
| 38 | 4 | u32 | Message offset | File offset of the song message. |
| 3C | 4 | u32 | Reserved | Reserved in ITTECH.TXT; used for the edit timer, or by OpenMPT. |
| 40 | 64 | u8 × 64 | Chnl Pan | Initial panning of each channel. |
| 80 | 64 | u8 × 64 | Chnl Vol | Initial volume of each channel, 0 to 64. |
| C0 | OrdNum | u8 | Orders | The order list. |
| … | InsNum × 4 | u32 | Instrument offsets | File offset of each instrument. |
| … | SmpNum × 4 | u32 | Sample offsets | File offset of each sample header. |
| … | PatNum × 4 | u32 | Pattern offsets | File offset of each pattern. |
Flags
| Bit | Value | Meaning when set |
|---|---|---|
| 0 | 01 | Stereo (clear: mono). |
| 1 | 02 | Volume-zero mixing optimisation: no mixing when the volume is 0. |
| 2 | 04 | Instrument mode (clear: sample mode, instruments are not used). |
| 3 | 08 | Linear slides (clear: Amiga slides). |
| 4 | 10 | Old effects: changes vibrato depth and timing, and how Oxx treats offsets past the end. |
| 5 | 20 | Links G’s memory with E and F; G retriggers envelopes when an instrument is on the row, and a sample change on a G row adjusts the frequency by the ratio of the new to the old C5 speed. |
| 6 | 40 | Use the MIDI pitch controller, with the depth from PWD. |
| 7 | 80 | Request the embedded MIDI configuration. |
Special
| Bit | Value | Meaning when set |
|---|---|---|
| 0 | 01 | A song message is attached. |
| 1 | 02 | An edit history follows the offset tables. Documented by OpenMPT; reserved in ITTECH.TXT. |
| 2 | 04 | Read the row highlights at offset 1E. Documented by OpenMPT; reserved in ITTECH.TXT. |
| 3 | 08 | The MIDI macro block is embedded in the file. |
Bits 4 to 15 are reserved.
Tracker versions
Cwt/v and Cmwt are stored as 0yxxh for Impulse Tracker version
y.xx: version 2.14 is 0214h. Cmwt below
0200h means the instruments use the
old layout. Programs other than
Impulse Tracker put their own number in the top digit of Cwt/v:
| Cwt/v | Program |
|---|---|
0xyy | Impulse Tracker x.yy; ModPlug and others often write this too |
1xyy | Schism Tracker up to 0.50; later versions encode a timestamp |
4xyy | pyIT |
5xyy | OpenMPT |
6xyy | BeRoTracker |
7xyz | ITMCK; 7FFF with Cmwt 0215 is munch.py |
8xyy | Tralala |
Cxyy | ChickDune ChipTune Tracker |
DAEB | spc2it |
D1CE | itwriter JavaScript library |
EFFF | rosetracker |
libxmp (it_load.c, lines 350 to 440) recognises more writers from the same
fields, from one program only: Cwt/v 0216 and 0217 are
Impulse Tracker 2.14 patch 3 and patch 5, unless 0217 comes with Cmwt
0200, which it takes to be ModPlug Tracker 1.16; Cwt/v 0214
with IBHC in the reserved field at 3C is Chibi Tracker; a Cwt/v
whose top byte is 0 it calls unmo3; and Cwt/v 0202 with Cmwt 0200
and the patterns stored before the samples it takes to be an early ModPlug Tracker.
The list is OpenMPT’s record of writers it has seen, and it is not closed. OpenMPT
1.17.02.20 to .25 wrote 0300, and 1.17.02.26 to 1.18 wrote
0888, in Cwt/v and Cmwt.
Channel settings
Each of the 64 channels has a pan byte and a volume byte.
| Pan value | Meaning |
|---|---|
| 0 | Hard left |
| 32 | Centre |
| 64 | Hard right |
| 100 | Surround |
| +128 (bit 7) | The channel is disabled: its notes do not play, but effects on it are still processed. |
Order list
OrdNum bytes from offset C0, each a pattern number. Impulse Tracker’s
order list uses the values FE (skip this entry, shown as +++) and
FF (end of song, shown as ---). OpenMPT 1.17 in compatibility mode omits
the final FF that ModPlug Tracker 1.16 writes.
Offset tables
Three tables of 32-bit file offsets follow the order list.
| Table | Starts at | Entries |
|---|---|---|
| Instruments | C0 + OrdNum | InsNum |
| Sample headers | C0 + OrdNum + InsNum × 4 | SmpNum |
| Patterns | C0 + OrdNum + (InsNum + SmpNum) × 4 | PatNum |
A pattern offset of 0 means an empty pattern of 64 rows, with no data stored.
Song message
When Special bit 0 is set, the message is at Message offset and is
MsgLgth bytes long. Lines end with a carriage return (0D) and the
message ends with a zero byte. Impulse Tracker 1.04 and later may store messages of up
to 8,000 bytes. ChibiTracker uses a line feed instead of a carriage return.
Edit history
Written by Impulse Tracker 2.08 and later, directly after the offset tables, when Special bit 1 is set. It starts with a 16-bit count of entries, each 8 bytes:
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 00 | 2 | u16 | date | FAT date of the edit. |
| 02 | 2 | u16 | time | FAT time of the edit. |
| 04 | 4 | u32 | open time | DOS timer, 1/18.2 seconds, that the song was open. |
Many programs set the flag and write two zero bytes for the count.
Edit timer
The reserved field at 3C holds the edit timer in some files. In Impulse
Tracker 2.07 it is the total edit time as a 32-bit DOS timer. In 2.08 and later it is
scrambled: to decode it, XOR with the bytes ITRK, rotate right 7 bits,
negate, rotate left 4 bits, and XOR with JTHL. Later OpenMPT versions in
normal mode store OMPT here instead; in compatibility mode the field holds
version bytes (from 1.29.10.00) or 0.
MIDI macro block
When Special bit 3 is set, a block of 4,896 bytes follows the edit history. Each macro is a 32-byte field holding a string of up to 31 characters, ended by a zero byte.
| Macros | Count | Used by |
|---|---|---|
| Global | 9 | Playback events (below) |
| Parametered | 16 | The macros chosen by SF0 to SFF |
| Fixed | 128 | Z80 to ZFF |
| Global macro | Default string |
|---|---|
| Playback start | FF |
| Playback stop | FC |
| Playback tick | empty |
| Note on | 9c n v |
| Note off | 9c n 0 |
| Change volume | empty |
| Change pan | empty |
| Bank select | Bc 0 a 20 b |
| Program change | Cc p |
The defaults above, SF0 = F0F000z, and Z80 to Z8F = F0F00100,
F0F00108 … F0F00178 are the contents of ITMIDI.CFG in the
Impulse Tracker source, which is the configuration Impulse Tracker starts with.
The macro language
A macro is text. Impulse Tracker reads it from left to right
(MIDITranslate in IT_MUSIC.ASM; the rules are written out in MIDI.TXT):
- The digits
0–9and the capital lettersA–Fare hexadecimal digits. Two in a row make one byte; a space ends a byte early, so9 nis the bytes 09 and the note. - A lower-case letter is a variable that takes a whole byte, except
c, which is a nibble (the MIDI channel, 0 to 15, put in the low half of the byte:9cis one byte). cthe instrument’s MIDI channel minus one;nthe note after the instrument’s keyboard table;mthe note as written in the pattern;vthe velocity (the volume without envelope and fade-out);uthe volume with them;othe last Oxx value;xthe set panning;ythe panning with the envelope;pthe MIDI program;aandbthe high and low bytes of the MIDI bank;hthe host channel;zthe Zxx parameter, 00 to 7F.
Impulse Tracker’s own drivers act on two messages (FILTERS.TXT): F0 F0 00 xx sets the filter
cutoff and F0 F0 01 xx the resonance, with xx from 00 to 7F (larger values are ignored);
cutoff 7F with resonance 0 means no filter. A MIDI start (FA), stop (FC) or reset
(FF) message resets them. OpenMPT adds F0 F0 02 xx (filter mode),
F0 F0 03 xx (plug-in dry/wet) and the plug-in parameters F0 F0 8x and F0 F1 xx.
Every other message is for a MIDI device and plays no sound on its own.
Zxx with xx below 80 uses the macro chosen by the channel’s last SFx (SF0 at the start of the song); Z80 to ZFF use the fixed macros. Files written by Impulse Tracker before 2.14 can hold Z macros that were never meant to be filters; OpenMPT ignores the fixed macros of a file made and compatible with a version below 2.14.
Chunks between the offset tables and the data (OpenMPT)
OpenMPT (and ModPlug Tracker 1.16) write extra chunks after the MIDI block and before the
first instrument, sample, pattern or message. Each is a four-letter ID, a 32-bit length and the data.
Impulse Tracker never looks at them: it goes by the offsets. Source: libopenmpt
soundlib/Load_it.cpp.
| ID | Data |
|---|---|
PNAM | 32 bytes of name for each pattern. |
CNAM | 20 bytes of name for each channel. |
CHFX | A 32-bit number for each channel: the mix plug-in it is routed to. |
FX00 to FX99, F100 to F255 | One mix plug-in: two 32-bit IDs, routing flags, mix mode, gain, a reserved byte, output routing, shell plug-in ID,
12 reserved bytes, a 32-byte name, a 64-byte library name, the length and bytes of the plug-in’s own data, then the length and bytes of modular data (chunks DWRT, PROG, MCRO). |
MODU | BeRoTracker’s marker. |
The history and MIDI block are only read when they end before the first parapointer, because early Schism Tracker versions set the history flag and wrote nothing.
Extended instrument and song fields (OpenMPT)
After the last sample (or the last pattern) OpenMPT writes XTPM, then a run of fields for the instruments,
and STPM, then a run of fields for the song. A field is a four-byte code, a 16-bit size and the data: for
XTPM the data repeats once for every instrument, for STPM it is one value. A code is four ASCII letters; most are written backwards
(..OF is “FO..”, the instrument fade-out), a few are written as they are (DTFR). The run ends at a code that has a high bit set
or none of the 0x60 bits in any byte, or at the next marker. The explorer names every field in libopenmpt’s
InstrumentExtensions.cpp and Load_it.cpp; a file written by OpenMPT 1.17 to 1.25 uses
them to keep note maps with sample numbers above 255, 120 envelope values, a pitch envelope release node and so on.
Files packed with MMCMP
Some IT files were packed with MMCMP (“ziRCONia” at offset 0, header and block layout in the Impulse Tracker source,
InternalDocumentation/MMTECH.TXT, which describes the wrapper). Such a file does not start with IMPM; the explorer does not unpack it.