FastTracker 2 ends its files with the data of the last sample, and its readers ignore any bytes after it. ModPlug Tracker 1.16 and OpenMPT use them for what the format has no place for: the song message, the MIDI macros, names for patterns and channels, the mix plug-ins and OpenMPT's own properties. Each part is a chunk: a four-letter name, a 32-bit size and the data, apart from the last two, which are runs of fields. A reader that does not know them can stop at the end of the last sample. The loaders read the chunks in the order below, and stop at the first name they do not know.
The chunks
| Name | Layout | Holds |
|---|---|---|
text | u32 size, then the text | The song message. Lines end with a carriage return (0D). |
MIDI | u32 size, then 153 macros of 32 bytes (4,896 bytes) | OpenMPT's MIDI macro configuration: 9 global macros, 16 parametered macros (SF0 to SFF) and 128 fixed macros (Z00 to Z7F), each a text of up to 31 characters with a zero at the end. |
PNAM | u32 size, then 32 bytes for each pattern | The pattern names. |
CNAM | u32 size, then 20 bytes for each channel | The channel names. |
CHFX | u32 size, then a u32 for each channel | The mix plug-in each channel is routed to (0 for none). |
FX00 to FX99, F100 to F255 | u32 size, then a plug-in record | One mix plug-in: 128 bytes of routing and names, then a u32 size and its saved state, then a u32 size and modular chunks (DWRT the dry/wet ratio as a float, PROG the default program, MCRO macros). |
XTPM | no size: fields follow | OpenMPT's extended instrument properties; its "MPTX" backwards. |
STPM | no size: fields follow | OpenMPT's extended song properties; its "MPTS" backwards. |
The plug-in record's 128 bytes are: two 32-bit plug-in IDs (the type and the unique ID), a routing flags byte (1 apply to master, 2 bypass, 4 wet mix, 8 expand mix, 16 auto suspend), a mix mode byte, a gain byte (divide by 10), a reserved byte, a 32-bit output routing (0 is the master, 0x80 plus n is plug-in n), a 32-bit shell plug-in ID, 12 bytes of reserved routing information, a 32-byte name and a 64-byte library name in UTF-8.
The explorer lists each chunk and its parts in the tree, shows the song message as text, the names as tables and the extension fields' values in a table.
Extension fields
After XTPM or STPM each field is a four-byte code, a 16-bit size and the
value. In XTPM the value is repeated once for every instrument of the module, in
order, all of the same size. The run ends at STPM (for the instruments), or at
a code that is not text, or when the file ends. OpenMPT writes the code as a 32-bit
number, so most codes appear reversed in the file: the code FO.. is the
bytes 2E 2E 4F 46. A few (DTFR, RSMP, CCOL,
AUTH, CUES, SWNG, PTTF) are stored as written.
The tables give OpenMPT's name for each code and what it holds.
0000057F 58 54 50 4D 53 54 50 4D 2E 42 50 52 04 00 04 00 XTPMSTPM.BPR....
0000058F 00 00 2E 4D 50 52 04 00 10 00 00 00 2E 2E 4D 54 ...MPR........MT
0000059F 01 00 00 2E 4D 4D 50 04 00 04 00 00 00 2E 56 57 .....MMP.......VW
000005AF 43 04 00 00 07 31 01 56 57 53 4C 04 00 00 07 31 C....1.VWSL....1
000005BF 01 2E 41 50 53 04 00 30 00 00 00 56 54 53 56 04 ..APS..0...VTSV.
000005CF 00 30 00 00 00 2E 46 53 4D 0F 00 01 07 02 00 00 .0....FSM........
000005DF 01 F8 FF FF 1F 40 27 04 00 01 41 55 54 48 08 00 .....@'...AUTH..
000005EF 4C 61 63 68 65 73 69 73 43 43 4F 4C 10 00 FF A8 LachesisCCOL....
XTPM is followed straight away by STPM. The fields are rows per beat 4, rows per measure 16, tempo mode 0, mix levels 4, created with and last saved with version 0x01310700 (OpenMPT 1.31.07.00), sample pre-amp 48, VST volume 48, the playback behaviour flags, the artist "Lachesis" and the channel colours.Instrument fields (XTPM)
| Code | Name | Code | Name |
|---|---|---|---|
FO.. | Volume fade-out | VP[. | Volume envelope tick positions |
GV.. | Global volume | PP[. | Panning envelope tick positions |
P... | Panning | PiP[ | Pitch envelope tick positions |
VLS. VLE. | Volume envelope loop start and end | VE[. | Volume envelope values |
VSB. VSE. | Volume envelope sustain start and end | PE[. | Panning envelope values |
PLS. PLE. | Panning envelope loop start and end | PiE[ | Pitch envelope values |
PSB. PSE. | Panning envelope sustain start and end | VE.. PE.. PiE. | Volume, panning and pitch envelope lengths |
PiLS PiLE | Pitch envelope loop start and end | VFLG AFLG PFLG | Volume, panning and pitch envelope flags |
PiSB PiSE | Pitch envelope sustain start and end | VERN AERN PERN | Volume, panning and pitch envelope release node |
NNA. DCT. DNA. | New note action, duplicate check and action | dF.. | Instrument flags |
PS.. VS.. | Panning and volume swing | NM[. | Note map (the note each key plays) |
IFC. IFR. | Default filter cutoff and resonance | n[.. fn[. | Name and file name (longer than XM's 22) |
CS.. RS.. FM.. | Cutoff swing, resonance swing, filter mode | R... | Resampling mode |
MB.. MP.. MC.. | MIDI bank, program, channel | PTTL PTTF | Pitch/tempo lock, integer and fractional part |
MiP. PVEH PVOH MPWD | Mix plug-in, velocity and volume handling, MIDI pitch wheel depth | PPS. PPC. VR.. | Pitch/pan separation and centre, volume ramp up |
Song fields (STPM)
| Code | Name | Code | Name |
|---|---|---|---|
DT.. DTFR | Default tempo, whole part and fraction (for tempos above 255) | CWV. LSWV | Created with and last saved with version (OpenMPT version number) |
RPB. RPM. | Rows per beat, rows per measure | SPA. VSTV DGV. | Sample pre-amp, VST instrument volume, default global volume |
C... | Channel count | RP.. | Restart position (not used for XM) |
TM.. | Tempo mode | RSMP | Resampling mode |
PMM. | Mix level mode | MIMA CCOL | MIDI mapping, channel colours (4 bytes a channel) |
AUTH | Artist (UTF-8) | ChnS | Channel settings for channels 65 and up (IT) |
CUES | Sample cue points | SWNG | Tempo swing |
MSF. | Playback behaviour flags: a bit set for each compatibility behaviour OpenMPT should use for this module (the FT2 behaviours listed in its source). These make OpenMPT play the module as the version that wrote it did. | ||
How readers find them
The explorer reads the chunks from the first byte after the last sample's data. libxmp does the
same and stops at XTPM; OpenMPT reads text, MIDI,
PNAM, CNAM, the plug-in chunks, then XTPM (only if
the module has instruments) and then STPM. A chunk whose size runs past the end of
the file is the last thing in a truncated file and the explorer says so. When a module with
the tracker name FastTracker v2.00 has one of these chunks, it was written by
ModPlug Tracker 1.16 or OpenMPT with the name copied (libxmp and OpenMPT both use that to
recognise ModPlug Tracker).