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 |
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 |
OpenMPT stores channel names, plugin data and other information in a separate extension block after this one. ModPlug-style data is outside ITTECH.TXT; this reference does not describe its contents.