A multichannel 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, which gives the number of channels. 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 | A restart position, or a value the player ignores. |
| 952 | 128 | u8 × 128 | order | The pattern played at each position. |
| 1080 | 4 | ASCII | signature | The channel count, as in 8CHN or 16CH. |
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. A sample that is not used has a length of 0.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 22 | text | name | The sample name, padded with zero bytes. Often used for messages: credits, greetings and the like. |
| 22 | 2 | u16 | length | The length in words of 2 bytes, so the data is 2 × length bytes. 0 means no sample. At most 65,535 words (128 KB). |
| 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. |
| 25 | 1 | u8 | volume | The default volume, 0 to 64 (40). |
| 26 | 2 | u16 | loop start | Where the loop starts, in words. |
| 28 | 2 | u16 | loop length | The length of the loop in words. 1, or 0 in some files, means no loop. |
00000014 70 69 61 6E 6F 00 00 00 00 00 00 00 00 00 00 00 piano...........
00000024 00 00 00 00 00 00 1F 40 0E 30 0F A0 0F A0 .......@.0....
| Bytes | Field | Value |
|---|---|---|
70 69 … 00 | name | “piano”, then 17 zero bytes to make 22 |
1F 40 | length | 8,000 words, 16,000 bytes |
0E | finetune | −2 |
30 | volume | 48 |
0F A0 | loop start | 4,000 words, byte 8,000 |
0F A0 | loop length | 4,000 words: the loop is the second half of the sample |
Finetune
The low four bits of byte 24 are a signed finetune in eighths of a semitone:
| 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 |
Within ProTracker’s three octaves the note’s period is looked up in ProTracker’s table for the sample’s finetune (see periods). For notes outside them, the explorer moves the period by the finetune directly: each eighth of a semitone divides the period by 21/96. The explorer reports a byte with any of the high four bits set.
Loops
Both loop fields count words. As ProTracker plays them:
- If the loop length is 1 (or 0), there is no loop: the sample plays once, from its start to its length.
- 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, then repeats the loop. Data after the end of the loop is never played.
A loop that ends after the end of its sample is a fault of the file, which the explorer reports.
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 is, in NoiseTracker’s use, the position to go back to after the
last one. PC trackers often write 0 here; ProTracker writes 127 (7F) and
ignores the byte. The multichannel files examined for this site had 0. The explorer’s
player, which ends the song at the end of the order list, does not use it.
Order table
The 128 bytes from offset 952 are the number of the pattern played at each position.
Only the first song length entries are played.
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, as ProTracker counts. Some PC trackers counted only the positions in use and left other numbers in the rest, naming patterns they never stored. 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. With patterns of several kilobytes each, counting one too many patterns would put the start of the sample data far off.
Signature
The four bytes at offset 1080 are ASCII and give the channel count, from 1 to 32 other than 4:
| Signature | Bytes | Channels | Written by |
|---|---|---|---|
1CHN to 9CHN, not 4CHN | 36 43 48 4E for 6CHN | the digit | PC trackers such as FastTracker |
two digits and CH, up to 32CH | 31 30 43 48 for 10CH | the number | FastTracker 2 and other PC trackers |
two digits and CN | 31 32 43 4E for 12CN | the number | a PC tracker; OpenMPT names none |
TDZ1 to TDZ9, not TDZ4 | 54 44 5A 36 for TDZ6 | the last digit | TakeTracker |
CD61, CD81 | 43 44 38 31 for CD81 | 6, 8 (the third character) | Octalyser (Atari STe and Falcon) |
OKTA, OCTA | 4F 4B 54 41 for OKTA | 8 | Oktalyzer, as OpenMPT records it |
The examples from the files examined for this site are 38 43 48 4E
(8CHN), 31 30 43 48 (10CH) and
32 38 43 48 (28CH). A count of 0 or above 32 is not a known
signature. Signatures with a count of 4 belong to the
ProTracker module, and FLT8 and
EXO8 to the StarTrekker
module.
00000438 38 43 48 4E 8CHN
438 in hexadecimal) of an 8-channel module