Skip to content
Techniques & Technology

MOD Format

The tracker music revolution

The MOD format combined samples with pattern-based sequencing in a single self-contained file, becoming the standard for game and demo music on the Amiga and across the chiptune scene.

commodore-amigaibm-pc audiotrackerdemo-sceneformatprotracker 1987–present

Overview

The MOD format, introduced with Ultimate Soundtracker (Karsten Obarski, Amiga, 1987) and refined into ProTracker, revolutionised game and demo music. It stores both digitised audio samples and the pattern data that tells the player when to play them — a self-contained music format far smaller than recorded audio. A typical 4-channel MOD is 50-200 KB; a comparable WAV recording would be megabytes.

The format's simplicity made it portable. Within a few years of the Amiga release, MOD players existed for PC, Atari ST, Acorn Archimedes, and even Linux — anywhere with a sample-capable sound chip. Demo coders, BBS sysops, and bedroom musicians spread MODs across modems and floppies; the format became the default soundtrack of the demoscene.

Fast facts

  • Origin: Ultimate Soundtracker (Amiga, 1987); refined by ProTracker (Amiga, 1990).
  • Channels: 4 in the canonical MOD (one per Paula channel); extensions add more.
  • Samples: 8-bit PCM, up to 31 instruments per file (15 in the earliest variants).
  • Patterns: 64 rows × 4 channels of note data, indexed and chained into a song sequence.
  • Effects: 16 effect commands per note (volume slide, portamento, vibrato, etc.).
  • Typical size: 100 KB – 1 MB.
  • Extensions: S3M (Scream Tracker), XM (FastTracker II), IT (Impulse Tracker) — each adding channels, finer envelopes, more samples.

File structure

A standard 31-instrument 4-channel MOD has a fixed layout:

OffsetSizeField
$000020 bytesSong name (zero-padded ASCII)
$001431 × 30 bytesInstrument records (see below)
$03B61 byteNumber of song positions (1-128)
$03B71 byteRestart byte (legacy field, usually 127)
$03B8128 bytesPattern order table (which pattern plays at each song position)
$04384 bytesFormat signature: M.K. (4-channel), 4CHN, 6CHN, 8CHN, etc.
$043CN × 1024 bytesPattern data (N = highest pattern index + 1)
(after)variableSample data — raw 8-bit signed PCM

The 1084-byte ($043C) header is followed by patterns and then samples. Older 15-instrument MODs lack the format signature and start at offset $01D8.

Instrument record (30 bytes)

OffsetSizeField
022Instrument name (zero-padded ASCII)
222Sample length in words (so byte length = ×2)
241Finetune (-8 to +7, signed nibble)
251Volume (0-64)
262Loop start in words
282Loop length in words (1 if no loop)

All multi-byte values are big-endian (Motorola 68000 native).

Pattern data (1024 bytes per pattern)

Each pattern is 64 rows × 4 channels × 4 bytes:

Row 0: ch0 ch1 ch2 ch3
Row 1: ch0 ch1 ch2 ch3
...
Row 63: ch0 ch1 ch2 ch3

Each cell is 4 bytes encoding the note, sample, and effect:

   Byte 0          Byte 1          Byte 2          Byte 3
+------------+ +------------+ +------------+ +------------+
| sample.hi  | | period.hi  | | sample.lo  | | effect.hi  |
| period.hi  | | period.lo  | | effect.hi  | | effect.lo  |
+------------+ +------------+ +------------+ +------------+

Decoded:
- sample number: bits (byte0 & $F0) | (byte2 >> 4)
- period:        ((byte0 & $0F) << 8) | byte1
- effect command: (byte2 & $0F)
- effect param:   byte3

The period is the Paula playback period — directly written to AUDxPER. Smaller period = higher pitch. A note table maps musical notes to periods based on the sample's finetune.

Effect commands

The effect nibble selects one of 16 commands:

CodeCommandBehaviour
0ArpeggioCycle between three notes within the row
1Slide upDecrease period (higher pitch)
2Slide downIncrease period (lower pitch)
3Tone portamentoGlide toward target note
4VibratoSine modulation of period
5Tone portamento + volume slide
6Vibrato + volume slide
7TremoloSine modulation of volume
8(unused in original)
9Set sample offsetSkip into sample by param × 256
AVolume slideAdd/subtract from volume
BPosition jumpJump to song position
CSet volumeDirect volume set
DPattern breakJump to next pattern at row param
EExtendedSub-effects in upper nibble of param
FSet speed/tempoSpeed (1-31) or BPM (32-255)

Paula playback

A MOD player runs at the pattern's tempo (default 50 ticks/second on PAL Amiga, divided by the speed value). Each tick:

  1. Process effect for each active channel (volume slide, portamento, etc.)
  2. Every speed ticks, advance to the next row
  3. New row: load sample, period, volume into AUDxLC/AUDxLEN/AUDxPER/AUDxVOL, enable DMA

The four MOD channels map directly to Paula's four DMA channels:

MOD chPaula chStereo side
10Left
21Right
32Right
43Left

This stereo split is hardwired in Paula and gives MODs their distinctive "channels 1+4 left, 2+3 right" panning. Some players add a software mixer to soften it.

Format extensions

FormatYearOriginKey additions
MOD1987Ultimate Soundtracker (Amiga)Original
S3M1993Scream Tracker 3 (PC)Up to 32 channels, multiple effect columns, GM/MIDI mapping
XM1994FastTracker II (PC)Volume/panning envelopes, instrument multi-sample, up to 32 channels
IT1996Impulse Tracker (PC)New volume column, NNA (new note actions), 64 channels, finer effects

Modern players (libxmp, OpenMPT) handle all four, often with sample-accurate playback. The chiptune scene continues to produce work in all these formats.

See also