Introduction
ProTracker 3.59, in 1996, could save a module in a file of a new form: an IFF file, the same outer shape as Amiga pictures and sounds, holding the song’s version, some information about it, a comment and the module itself. Later versions to 3.62 write it too. The module inside is an ordinary ProTracker module, so the wrapper is the only thing a reader must add.
No specification of the wrapper was published; what follows is from OpenMPT’s loader for it, which is the source of everything here.
A .mod file of this kind dropped on any page of this site opens in the
explorer, which shows each chunk and gives the embedded module an Open button; opened,
it is read and played as any other module.
Structure
A 12-byte header, then chunks, one after the other to the end of the file. All numbers are big-endian.
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | magic | FORM |
| 4 | 4 | size | The form size. OpenMPT does not check it. |
| 8 | 4 | type | MODL |
Each chunk is an 8-byte header, four letters and a 32-bit size, then its data. The
size of a chunk counts the 8-byte header, and the first chunk’s also counts the four
bytes of MODL: subtract 8 for the data length, and 4 more for the first
chunk. A chunk with another name is skipped.
VERS: the version
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | skipped | Skipped. |
| 4 | 2 | magic | PT |
| 6 | rest | version | Text, such as 3.61. If there is none, 3.6 is assumed. |
INFO: the song
The chunk must hold at least 64 bytes; OpenMPT reads these 64 and ignores the rest:
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 32 | name | The song’s name, up to 32 characters; if the first byte is not 0 it replaces the title in the module. |
| 32 | 2 | samples | Read by OpenMPT but not used. |
| 34 | 2 | orders | Read by OpenMPT but not used. |
| 36 | 2 | patterns | Read by OpenMPT but not used. |
| 38 | 2 | volume | If not 0, a sample pre-amp, at most 64. |
| 40 | 2 | tempo | If not 0 and the song does not use vertical-blank timing, the default tempo. |
| 42 | 2 | flags | Bit 8 (0100) set means CIA timing; clear means vertical-blank timing. |
| 44 | 12 | date saved | Six 16-bit numbers: day, month, year since 1900, hour, minute and second. |
| 56 | 8 | playing time | Four 16-bit numbers: hours, minutes, seconds and milliseconds. Read by OpenMPT but not used. |
CMNT: author and comment
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 32 | author | Text. UNNAMED AUTHOR is ProTracker’s placeholder and means none; OpenMPT, and the explorer, show no author for it. |
| 32 | rest | comment | Text, wrapped to lines of 40 characters. |
PTDT: the module
The chunk’s data is a whole module, starting with the module’s title. OpenMPT reads more than the chunk’s stated size, up to 31 × 65,536 bytes more, because some files record their sample sizes wrongly. A reader should use the size only as a guide and read the module by its own header. The explorer works out the module’s length from its header, its patterns and its sample lengths; when that is more than the chunk says, it reads the module to that length, says so, and reads no further chunks, since their positions no longer line up.
How the wrapper changes the module
OpenMPT plays every module from a PT36 file the same way, whatever INFO
says: in ProTracker mode (no NoiseTracker reading of its effects), with
8xx and E8x panning ignored, with ProTracker’s one-shot
loops (a sample whose loop starts at 0 plays its whole length once before it loops),
and without the sample swapping some other files need. It applies INFO
only when it has read both INFO and PTDT, and then:
- flags bit 8 clear: vertical-blank timing, so every
Fxxis a speed; - otherwise a tempo that is not 0 is the starting tempo;
- a volume that is not 0 is the pre-amp, at most 64, a mixing level;
- a name whose first byte is not 0 replaces the module’s title;
- a valid date is kept as the date it was saved.
The explorer does the same: besides the chunks, it plays the module with these
changes and lists them. The pre-amp is shown but not applied, because the explorer
evens out the level of every render. Opened on its own from the PTDT
chunk, the module is read as an ordinary .mod, without them.
Also used for
- Go module file – A Go module's path, Go version and dependencies, as line-oriented UTF-8 text.
Variants
- ProTracker module (M.K.) – 31 samples and 4 channels, marked M.K. at offset 1080: the standard Amiga module
- Multichannel module (xCHN, xxCH) – 31 samples and any channel count other than 4, marked 6CHN, 8CHN, 16CH and so on
- StarTrekker 8-channel module (FLT8) – 8 channels, each pattern stored as two 4-channel patterns
- Soundtracker module (15 samples) – the first modules, 1987 to 1989: 15 samples and no signature
- ProTracker 3.6 module (IFF) – an IFF wrapper around a module, with version, song information and a comment
Links
Software
- OpenMPT – free tracker that opens these files (Windows)
Developers
- libopenmpt – OpenMPT’s playback library, which reads them (C, C++)
Reference
- OpenMPT’s ProTracker 3.6 loader – the chunks and their fields (C++)