An instrument maps notes to samples and adds envelopes and new note actions. Each one
starts IMPI and is found through the
instrument offset table. There are
two layouts, chosen by Cmwt in the header: below 0200h the
old layout, otherwise the new layout. Both are 554
bytes when stored. Offsets on this page are in hexadecimal.
Old instrument (Cmwt below 200h)
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 00 | 4 | ASCII | magic | IMPI. |
| 04 | 12 | text | filename | DOS 8.3 file name. |
| 10 | 1 | u8 | null | Always 0. |
| 11 | 1 | u8 | Flg | Envelope flags: bit 0 use the volume envelope, bit 1 volume loop, bit 2 sustain loop. |
| 12 | 1 | u8 | VLS | Volume loop start, a node number. |
| 13 | 1 | u8 | VLE | Volume loop end. |
| 14 | 1 | u8 | SLS | Sustain loop start. |
| 15 | 1 | u8 | SLE | Sustain loop end. |
| 16 | 2 | – | unused | |
| 18 | 2 | u16 | FadeOut | 0 to 64. The fade count is 512. |
| 1A | 1 | u8 | NNA | New note action. |
| 1B | 1 | u8 | DNC | Duplicate note check: 0 off, 1 on. |
| 1C | 2 | u16 | TrkVers | Tracker version; meaningful only in instrument files. |
| 1E | 1 | u8 | NoS | Number of samples; meaningful only in instrument files. |
| 1F | 1 | – | unused | |
| 20 | 26 | text | name | Includes the terminating zero byte. |
| 3A | 6 | – | unused | |
| 40 | 240 | keyboard | note-sample table | 120 pairs of note and sample. |
| 130 | 200 | u8 × 200 | volume envelope | The precalculated envelope, 0 to 64 per tick; FF marks its end. |
| 1F8 | 50 | u8 × 2 × 25 | nodes | 25 nodes of two bytes: tick, then magnitude. |
Fade-out applies after a note fade, after a note-off with no envelope or a looping envelope, and after the volume envelope ends.
New instrument (Cmwt 200h or later)
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 00 | 4 | ASCII | magic | IMPI. |
| 04 | 12 | text | filename | DOS 8.3 file name. |
| 10 | 1 | u8 | null | Always 0. |
| 11 | 1 | u8 | NNA | New note action. |
| 12 | 1 | u8 | DCT | Duplicate check type. |
| 13 | 1 | u8 | DCA | Duplicate check action. |
| 14 | 2 | u16 | FadeOut | 0 to 128. The fade count is 1,024. |
| 16 | 1 | s8 | PPS | Pitch-pan separation, −32 to +32. |
| 17 | 1 | u8 | PPC | Pitch-pan centre, a note 0 to 119. |
| 18 | 1 | u8 | GbV | Global volume, 0 to 128. |
| 19 | 1 | u8 | DfP | Default pan 0 to 64; bit 7 set means do not use it. |
| 1A | 1 | u8 | RV | Random volume variation, percent. |
| 1B | 1 | u8 | RP | Random pan variation; not implemented in Impulse Tracker. |
| 1C | 2 | u16 | TrkVers | Tracker version. |
| 1E | 1 | u8 | NoS | Number of samples. |
| 1F | 1 | – | unused | |
| 20 | 26 | text | name | Includes the terminating zero byte. |
| 3A | 1 | u8 | IFC | Initial filter cutoff. |
| 3B | 1 | u8 | IFR | Initial filter resonance. |
| 3C | 1 | u8 | MCh | MIDI channel. |
| 3D | 1 | u8 | MPr | MIDI program. |
| 3E | 2 | u16 | MIDIBnk | MIDI bank. |
| 40 | 240 | keyboard | note-sample table | 120 pairs of note and sample. |
| 130 | 82 | envelope | volume envelope | |
| 182 | 82 | envelope | panning envelope | |
| 1D4 | 82 | envelope | pitch envelope | Or a filter envelope, by its flag. |
The data is 547 bytes, and 554 are stored so that the old layout still loads. ModPlug and OpenMPT spaced instruments differently in some versions: alpha 5 to beta 1 used 560 bytes and beta 2 and later 557, so use the offset table rather than a fixed size.
New note action
| Value | Meaning |
|---|---|
| 0 | Note cut |
| 1 | Note continue |
| 2 | Note off |
| 3 | Note fade |
Duplicate check type
| Value | Meaning |
|---|---|
| 0 | Off |
| 1 | Note |
| 2 | Sample |
| 3 | Instrument |
Duplicate check action
| Value | Meaning |
|---|---|
| 0 | Note cut |
| 1 | Note off |
| 2 | Note fade |
Keyboard table
120 pairs of bytes. The pair at each index is what that key plays.
| Byte | Value |
|---|---|
| Note | 0 to 119, C-0 to B-9. |
| Sample | 1 to 99; 0 means no sample. |
Envelope (new layout)
Each of the three envelopes is 82 bytes.
| Offset | Size | Name | Description |
|---|---|---|---|
| +0 | 1 | Flg | Flags (below). |
| +1 | 1 | Num | Number of node points used. |
| +2 | 1 | LpB | Loop start node. |
| +3 | 1 | LpE | Loop end node. |
| +4 | 1 | SLB | Sustain loop start node. |
| +5 | 1 | SLE | Sustain loop end node. |
| +6 | 75 | Nodes | 25 nodes of three bytes: a value, then a 16-bit tick from 0 to 9,999. |
| +81 | 1 | pad | Unused. |
| Flag bit | Meaning when set |
|---|---|
| 0 | Envelope on. |
| 1 | Loop on. |
| 2 | Sustain loop on. |
| 3 | Envelope carry. Not in ITTECH.TXT; documented by OpenMPT. |
| 7 | Pitch envelope only: use it as a filter envelope. |
| Envelope | Node values |
|---|---|
| Volume | 0 to 64. |
| Panning | −32 to +32. |
| Pitch | −32 to +32: each step is half a semitone, interpolated 64 times per step. Positive raises the pitch. |