A MOD file carries a whole band with it. Where a Commodore 64 tune is a program that tells a synthesiser chip what to do, an Amiga module holds real recorded sounds, a drum kit, a bass, a voice, together with the score that says when to play each one. Each sample is stored once and replayed at different pitches as often as the music needs it, so the file is mostly sample data and the song itself costs a few kilobytes of patterns. The format came from Karsten Obarski’s Ultimate Soundtracker, reached its common 31-sample form in the hacked versions that followed, and settled in ProTracker. Nobody ever published a specification for it. In 1993 its users collected what they had worked out into a text that still begins, “This is all the information I was able to find on MOD files”, and the final word on how a module sounds is still the replay routine that played it.
Fast facts
- Origin: Ultimate Soundtracker, Karsten Obarski, Amiga, end of 1987; 15 samples per song.
- Common form: 31 samples and the tag
M.K., from the hacked Soundtrackers; written by NoiseTracker and ProTracker. - Channels: four, one for each of Paula’s sound channels; later trackers wrote six- and eight-channel variants.
- Samples: signed 8-bit, up to 31 per file, lengths and loops counted in 16-bit words.
- Patterns: 64 rows × 4 channels × 4 bytes = 1,024 bytes each, played in the order given by a 128-entry list.
- Effects: one effect command per note, chosen from 16 codes, one of them unused and one (
E) opening a second set of extended commands. - Header: 1,084 bytes, fixed; everything after it is patterns and samples.
- Successors: S3M (Scream Tracker 3), XM (Fasttracker 2), IT (Impulse Tracker).
The file, byte by byte
What follows is the common 31-sample, four-channel module written by ProTracker. It agrees with the tracker music entry’s summary of the same layout. All multi-byte numbers are big-endian, the order the Amiga’s 68000 processor uses, so a player on a PC has to swap the bytes of every word it reads.
| Offset | Bytes | Contents |
|---|---|---|
0 ($000) |
20 | Song name, padded with zero bytes |
20 ($014) |
31 × 30 | Sample records (below) |
950 ($3B6) |
1 | Song length: how many entries of the order list to play, 1–128 |
951 ($3B7) |
1 | Unused by ProTracker, usually 127; NoiseTracker kept a restart position here |
952 ($3B8) |
128 | Order list: the pattern number to play at each song position |
1080 ($438) |
4 | Format tag, usually M.K. |
1084 ($43C) |
1,024 each | Patterns, as many as the highest number anywhere in the order list, plus one |
| after | Sample data, signed 8-bit, one sample after another in sample-number order |
The order list is scanned in full, all 128 entries, to count the patterns, even the entries beyond the song length. A player that stops at the song length can miscount and look for the samples in the wrong place.
The tag at offset 1080 identifies the variant. A 15-sample module from the original Soundtracker has no tag at all: its sample records stop after 15 entries, its song length sits at offset 470, and its patterns start at offset 600. StarTrekker writes FLT4 or FLT8, other trackers 4CHN, 6CHN or 8CHN, and ProTracker 2.3 writes M!K! when a song uses more than 64 patterns. Who first wrote M.K. is disputed even in the format’s own documentation. The 1993 compilation says Mahoney and Kaktus, the authors of NoiseTracker, inserted it “when they increased the number of samples from 15 to 31”. Andrew Scott’s later revision of the text says the letters are the initials of Unknown of the group D.O.C., “sorry.. they were not inserted by Mahoney & Kaktus”.
Sample records (30 bytes each)
| Offset | Bytes | Contents |
|---|---|---|
| 0 | 22 | Sample name, padded with zero bytes |
| 22 | 2 | Length in words; multiply by 2 for bytes. A length of 0 or 1 means no sample |
| 24 | 1 | Finetune: the low four bits, a signed value from −8 to +7; mask off the high four |
| 25 | 1 | Volume, 0–64 |
| 26 | 2 | Loop start, in words from the start of the sample |
| 28 | 2 | Loop length in words; the sample loops only if this is greater than 1 |
Musicians used the names as a notice board. The 1993 documentation notes that sample names “are often used for storing messages from the author”, and that a name beginning with # was, by convention, a message rather than an instrument.
The note cell
A pattern is 64 rows, each holding one 4-byte cell per channel, channel 1 first. Every cell packs the same four fields:
byte 0: SSSS PPPP S = upper 4 bits of the sample number
byte 1: PPPP PPPP P = 12-bit period (the pitch)
byte 2: SSSS EEEE S = lower 4 bits of the sample number, E = effect command
byte 3: XXXX XXXX X = effect parameter
sample = (byte0 & 0xF0) | (byte2 >> 4)
period = ((byte0 & 0x0F) << 8) | byte1
effect = byte2 & 0x0F, parameter = byte3Zeros mean “nothing new”. A sample number of zero means the channel keeps its previous sample, and a period of zero means no new note: the channel keeps its previous pitch. In ProTracker’s replay routine a sample number without a note does not restart the sound; it sets the channel’s volume to that sample’s volume and makes it the sample for the next note.
Periods and pitch
The note is stored not as a note name but as a period, the value the replay routine writes to Paula’s period register: the number of clock ticks between one sample byte and the next. A smaller period is a higher note. The standard table, for finetune 0, covers three octaves:
C-1 to B-1: 856 808 762 720 678 640 604 570 538 508 480 453
C-2 to B-2: 428 404 381 360 339 320 302 285 269 254 240 226
C-3 to B-3: 214 202 190 180 170 160 151 143 135 127 120 113The playback rate is the Amiga’s clock divided by twice the period. On a European (PAL) machine the clock is 7,093,789.2 Hz, so C-2, period 428, plays at about 8,287 samples a second; an American (NTSC) machine runs at 7,159,090.5 Hz and plays every module about 1 per cent sharp. There is no standard sample rate, Lars Hamre explained in 1993, but “most often the samples are done on the rate called C-3”, period 214, “about 16574 Hz if you have a PAL machine”. Finetune does not change the stored period. It picks one of 16 period tables, each a step of an eighth of a semitone, and the replay routine finds the note’s place in the standard table and reads the period from the tuned one.
Time: ticks, speed and tempo
A module plays in ticks. The replay routine runs once a tick, 50 times a second by default, and the song’s speed is the number of ticks per row, 6 unless the song changes it. At the defaults a row lasts 120 milliseconds.
The F command sets both numbers. In ProTracker a value below 32 ($20) sets the speed; a value of 32 or more sets the tempo, in beats per minute, which ProTracker turns into a period for one of the Amiga’s CIA timer chips: 1,773,447 divided by the tempo. Tempo 125 gives the old 50 Hz tick, and in general a tick lasts 2.5 ÷ tempo seconds. F00 stops the song: the replay routine stores the zero speed and branches to its routine for stopping playback. Andrew Scott’s revision describes a different convention that some players follow, with 32 counted as a speed and F00 treated as F01; a player that means to sound like ProTracker follows the replay routine.
Within a row the ticks are not all alike, and this is the detail that most often goes wrong in a new player:
- The first tick reads the row. For each channel the routine takes the new sample and note, starts the sound, and applies the effects that act once: sample offset, position jump, set volume, pattern break, most
Ecommands and set speed. - Every later tick of the row runs the continuous effects instead: arpeggio, the pitch slides, tone portamento, vibrato, tremolo and volume slide. So do the
Ecommands that act part-way through a row, such as note cut and retrigger. The continuous effects do not run on the first tick, so at speed 6 a slide acts five times a row, not six. - After the last tick the routine moves to the next row, or to the row a pattern break or position jump asked for. After row 63 it moves to the next song position, and after the last position it goes back to position 0.
Effect commands
| Code | Effect | Notes for a player |
|---|---|---|
0xy |
Arpeggio | Cycles the note, the note + x semitones and the note + y semitones, one per tick; 000 is no effect |
1xx |
Slide up | Subtracts xx from the period each tick after the first |
2xx |
Slide down | Adds xx to the period |
3xx |
Tone portamento | Slides towards the row’s note instead of starting it |
4xy |
Vibrato | Speed x, depth y; changes the period sent to Paula, not the stored one |
5xy |
Tone portamento + volume slide | |
6xy |
Vibrato + volume slide | |
7xy |
Tremolo | Vibrato applied to the volume |
8xx |
Not used | |
9xx |
Sample offset | Starts the sample xx × 256 bytes in; 900 reuses the last offset |
Axy |
Volume slide | Up by x or down by y each tick after the first |
Bxx |
Position jump | Continues at song position xx |
Cxx |
Set volume | 00–40; higher values are held at 64 |
Dxy |
Pattern break | Continues at the next song position, at row x × 10 + y: the parameter is read as decimal |
Exy |
Extended | x picks one of 16 more commands, from filter control and fine slides to note delay and pattern loop |
Fxx |
Speed or tempo | Below $20 speed, from $20 tempo; F00 stops |
The pattern break is the trap in this table. D10 means row 10, not row 16, because the parameter is read as two decimal digits; a value past row 63 goes to row 0.
Playing it on Paula
On the Amiga the replay routine does no mixing at all. Each of the four module channels drives one of Paula’s four DMA sound channels directly. To start a note, ProTracker’s routine turns the channel’s DMA off, writes the sample’s address, length and period to the channel’s registers, sets its volume and turns DMA back on. Once the chip has started, the routine writes the loop’s start and length to the same registers, so that when Paula reaches the end of the sample it carries on round the loop. The first word of every sample is kept at zero so that a sample with no loop can idle on silence.
The stereo is wired into the machine. The Amiga Hardware Reference Manual states that “Channels 0 and 3 are connected to the left-side stereo output jack. Channels 1 and 2 are connected to the right-side output jack.” So in every four-channel module, channels 1 and 4 play on the left and channels 2 and 3 on the right, with nothing in the middle. A player on another machine has to mix the four channels itself, and many soften that hard split.
Beyond the Amiga
Because a module is data, not code, any machine that could replay samples could play one. Acorn User reviewed Tracker for the Archimedes in July 1991, noting that it “originally appeared on the Commodore Amiga as SoundTracker” and could load Amiga music and sample files “provided that they are in the correct disc format”. The French ST Magazine put ProTracker for the Atari ST on its cover disk in November 1991, and PC Review found Scream Tracker loading NoiseTracker, Soundtracker and ProTracker songs on the PC in August 1992.
The PC trackers then went past the format and gave their own files new names:
| Format | Tracker | What it added |
|---|---|---|
| S3M | Scream Tracker 3 | A separate volume column, and FM instruments for the Yamaha OPL2 chip alongside samples |
| XM | Fasttracker 2 | Instruments that map several samples across the keyboard, with volume and panning envelopes |
| IT | Impulse Tracker | Instruments with “new note actions”, which decide what happens to a note still sounding when the next one starts |
From one program to a standard
The format outlived the legal muddle of its birth. Ultimate Soundtracker was a commercial program, but most people used cracked and rewritten copies, and Amiga Format’s editors told a reader in March 1990 that “Sound Tracker (in all its incarnations) still remains on dodgy ground”. The rewrites kept the file. When Amiga Format’s public-domain column found NoiseTracker, StarTrekker and “Protracker V1.0, which bears a distinct resemblance to the infamous SoundTracker” together on one disk in December 1990, it called them “a noble continuation of the Tracker saga”, and the M.K., FLT4 and M!K! tags at offset 1080 are the marks those programs left in it. The SoundTracker entry tells that story in full.
Sources
- Lars Hamre, Steinar Midtskogen, Peter Hanning and others, MOD file format documentation compiled at ftp.cwi.nl, March 1993 (web, secondary): ProTracker 2.3A song/module format; offsets and sample records; the order list and pattern count;
M.K.attributed to Mahoney and Kaktus,FLT4,FLT8,M!K!; the note cell and its C decode; the period table; finetune; Hamre on sample rates, the PAL and NTSC clocks and C-3 at 16,574 Hz; the effect command table; the CIA tempo formula. https://www.eblong.com/zarf/blorb/mod-spec.txt - Andrew Scott, “Noisetracker/Soundtracker/Protracker Module Format”, 4th revision, 2003 (web, secondary):
M.K.attributed to Unknown/D.O.C.;4CHN,6CHN,8CHN; 15-sample modules; sample length 1 as empty; loops only when longer than one word; zero sample and zero period; C-2 at period 428 and 8,287 Hz; channels 1 and 4 left, 2 and 3 right; the pattern break read as decimal; its own convention for theFcommand. https://www.aes.id.au/modformat.html - Frank Wille, ptplayer, Protracker V2.3B playroutine (68000 source, public domain; version 6.3 read, published on Aminet as mus/play/ptplayer): default speed 6 and tempo 125; counting patterns over all 128 order entries; empty samples; sample without a note; the first-tick and later-tick effect tables;
Fbelow$20as speed andF00stopping playback; the decimal pattern break; volume held at 64; sample offset in 256-byte steps; the DMA and loop-register sequence; the song returning to position 0. https://aminet.net/package/mus/play/ptplayer - Amiga Hardware Reference Manual, Commodore-Amiga, 1985, p. 134: channels 0 and 3 left, 1 and 2 right.
- Rob Miller, review of Tracker, Acorn User issue 108, July 1991, p. 111.
- ST Magazine (France) issue 56, November 1991: ProTracker for the STF and STE on the cover disk (in French).
- PC Review issue 10, August 1992: review of Scream Tracker.
- OpenMPT Wiki, “Manual: Module formats” (web, secondary): the S3M volume column and OPL2 instruments, XM instruments and envelopes, IT new note actions. https://wiki.openmpt.org/Manual:_Module_formats
- Amiga Format issue 8, March 1990, pp. 136–137: letter, “Whose domain?”, and reply. Issue 17, December 1990: public-domain column (NoiseTracker, StarTrekker, ProTracker V1.0).
See also
- SoundTracker — where the format began
- ProTracker — the tracker that fixed its common form
- Tracker music
- Paula — the sound chip the format was built around
- Demo scene