A ProTracker module starts with a 1,084-byte header: the song title, a header for each of the 31 samples, the song length, the restart byte, the order table and the signature. The patterns follow straight after it. All numbers are big-endian, most significant byte first, and the header has no padding.
Layout
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 20 | text | title | The song title. |
| 20 | 930 | 31 × 30 bytes | samples | The sample headers, sample 1 first. |
| 950 | 1 | u8 | song length | How many positions of the order table are played. |
| 951 | 1 | u8 | restart | NoiseTracker’s restart position; 127 from ProTracker. |
| 952 | 128 | u8 × 128 | order | The pattern played at each position. |
| 1080 | 4 | ASCII | signature | M.K. or another 4-channel signature. |
Title
The first 20 bytes are the song title, as single-byte text padded with zero bytes. A title of exactly 20 characters has no zero after it, and some files have no title at all.
Sample headers
From offset 20 come 31 sample headers of 30 bytes each. Sample numbers in the patterns count from 1, so the header of sample n is at 20 + (n − 1) × 30, and sample 31’s ends at 950. A sample that is not used has a length of 0, and usually an empty name.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 22 | text | name | The sample name, padded with zero bytes. |
| 22 | 2 | u16 | length | The length in words of 2 bytes, so the data is 2 × length bytes. 0 means no sample. The field allows up to 65,535 words (128 KB); the programs set lower limits of their own. |
| 24 | 1 | u8 | finetune | The low four bits are a signed finetune, −8 to +7 eighths of a semitone. The high four bits are unused and should be 0. |
| 25 | 1 | u8 | volume | The default volume, 0 to 64 (40). The Amiga plays a higher value as 64. |
| 26 | 2 | u16 | loop start | Where the loop starts, in words from the start of the sample. |
| 28 | 2 | u16 | loop length | The length of the loop in words. 1 means no loop. |
Musicians used the 31 names as much for messages as for names: credits, greetings,
the tracker’s name, the name of a bulletin board and its phone number. In the files
examined for this site, sample names copied from the Soundtracker sample disks keep the
disk’s name in front, as in st-02:snare14.
00000014 73 74 2D 30 32 3A 73 6E 61 72 65 31 34 00 00 00 st-02:snare14...
00000024 00 00 00 00 00 00 0D AC 00 40 00 00 00 01 .........@....
| Bytes | Field | Value |
|---|---|---|
73 74 … 00 | name | “st-02:snare14”, then 9 zero bytes to make 22 |
0D AC | length | 3,500 words, 7,000 bytes |
00 | finetune | 0 |
40 | volume | 64, full volume |
00 00 | loop start | 0 |
00 01 | loop length | 1 word: no loop |
Finetune
ProTracker 1.0c and later use the low four bits of byte 24 as a finetune, which retunes the sample by up to just under a semitone either way. Before then the byte was always 0, which is finetune 0, so older files read correctly. The value is a signed four-bit number:
| Low four bits | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Finetune | 0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | −8 | −7 | −6 | −5 | −4 | −3 | −2 | −1 |
Each step is an eighth of a semitone. ProTracker does not compute the change: it has a separate table of periods for each finetune, and the note’s period is looked up in the sample’s row (see periods). The effect E5x sets a finetune for one note. The explorer reports a byte with any of the high four bits set.
Loops
A sample either plays once or plays and then repeats a loop for as long as the note lasts. Both loop fields count words. ProTracker plays them like this:
- If the loop length is 1, there is no loop: the sample plays once, from its start to its length. (After that the Amiga’s voice keeps playing the sample’s first two bytes, which are 0 by convention, so it falls silent.)
- If the loop start is 0 and the loop length is more than 1, the sample plays its
first
lengthwords, then repeats its firstloop lengthwords. - If the loop start is not 0, the sample plays from its start to the end of the loop,
loop start + loop lengthwords, and then repeats the loop. Data after the end of the loop is never played.
ProTracker writes 1 for no loop. Some other programs write 0, which OpenMPT notes would make ProTracker freeze; the explorer treats 0 as no loop. A loop that ends after the end of its sample is a fault of the file, which the explorer reports. How the Amiga’s sound chip does this is on How it plays.
For example, a sample of 4,000 words with a loop start of 1,000 and a loop length of 2,000 plays words 0 to 2,999 once, then repeats words 1,000 to 2,999. Words 3,000 to 3,999 are never heard.
Song length
The byte at offset 950 is the number of positions in the song, 1 to 128: positions 0 to song length − 1 of the order table are played, in order. The explorer reports a value of 0 or above 128.
Restart
The byte at offset 951 had different uses in different programs:
| Value | Meaning |
|---|---|
| below the song length | NoiseTracker 1.1 and later: the position to go back to after the last one. |
127 (7F) | Written by ProTracker, which ignores the byte and always goes back to position 0. |
120 (78) | The value Soundtracker kept in this byte as its tempo, left there by a conversion. OpenMPT treats it as no restart. |
| 0 | Often written by PC trackers. |
In the files examined for this site, ProTracker files had 127, files from PC trackers had 0, and one file had 120. The explorer’s player, following ProTracker, does not use the byte.
Order table
The 128 bytes from offset 952 are the order table: the number of the pattern played
at each position. Only the first song length entries are played, and a
pattern can appear at any number of positions. In files before ProTracker 2.3 the
numbers are 0 to 63; ProTracker 2.3 allows up to 100 patterns.
The number of patterns stored in the file is one more than the highest number in all 128 entries, including those after the song length. That is ProTracker’s rule, and it is how a reader finds where the sample data starts. Some PC trackers left numbers in the unused entries that name patterns they did not store. When the file is too short for the count from all 128 entries but fits the count from the played positions alone, the explorer takes the second count and says so.
000003B6 11 78 07 08 09 00 01 02 03 …
The song is 17 (11) positions long, the restart byte is 120
(78), and positions 0 to 6 play patterns 7, 8, 9, 0, 1, 2 and 3.
Signature
The four bytes at offset 1080 are ASCII letters that mark a 31-sample module and give its channel count. Signatures with a count other than 4 belong to the multichannel and FLT8 formats. The ones read as this format, with 4 channels:
| Signature | Bytes | Written by |
|---|---|---|
M.K. | 4D 2E 4B 2E | Soundtracker 2.3 onwards, NoiseTracker, ProTracker, and most trackers since |
M!K! | 4D 21 4B 21 | ProTracker 2.3 and later, when the module has more than 64 patterns |
FLT4 | 46 4C 54 34 | StarTrekker |
EXO4 | 45 58 4F 34 | StarTrekker |
4CHN | 34 43 48 4E | PC trackers such as FastTracker |
N.T. | 4E 2E 54 2E | NoiseTracker (as OpenMPT records it) |
PATT | 50 41 54 54 | ProTracker 3.6 (as OpenMPT records it) |
NSMS | 4E 53 4D 53 | one known module (as OpenMPT records it) |
LARD | 4C 41 52 44 | one known module (as OpenMPT records it) |
TDZ4 | 54 44 5A 34 | TakeTracker’s signature with a count of 4 |
04CH, 04CN | 30 34 43 48, 30 34 43 4E | the two-digit signatures with a count of 4 |
Modules from StarTrekker (FLT4 and EXO4) use the E effects
for StarTrekker’s own synthesised sounds; see
Effects.
00000438 4D 2E 4B 2E M.K.
438 in hexadecimal)