Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:ProTracker MOD

From ReverseEngineering.wiki
Format
Magic tag at 0x438: M.K. / M!K! / 6CHN / 8CHN / xxCH
Extensions .mod, .nst, mod.*
Endianness big
On this wiki Facts · Code · Notes · Topics

The Amiga tracker module (.mod, also .nst, mod.* prefix on the Amiga): 20-byte title, sample headers, a 128-entry order table and, in the 31-sample form, a 4-byte tag at offset 1080 (M.K., M!K!, 6CHN, 8CHN, xxCH...) that gives the channel count; 4-byte pattern cells and raw 8-bit signed samples follow.

Overview

MOD is the song format of Ultimate Soundtracker, NoiseTracker and ProTracker on the Platform:Amiga, reused by many DOS and Amiga games for music (samples and note data in one file, played by a replayer routine inside the game). All multi-byte values are big-endian. Later PC trackers (Format:Scream Tracker 3 module (S3M), Format:FastTracker 2 module (XM), Format:Impulse Tracker module (IT)) kept the idea but not the layout.

Layout

Offset Size Field
0 20 song title
20 31 x 30 sample headers (see Fact:ProTracker MOD/struct/Sample header)
950 1 song length (orders used)
951 1 restart byte (0x7F in some Scream Tracker converted files)
952 128 order table (pattern numbers)
1080 4 format tag (31-sample form only)
1084 n x 1024 for 4 channels patterns: 64 rows x channels x 4-byte cells
after patterns raw 8-bit signed sample data, in sample order

The number of stored patterns is the highest value in the order table plus one (libxmp scans all 128 entries and stops at a value above 0x7F, not only the first song-length entries).

Identification

Read 4 bytes at offset 1080. See Fact:ProTracker MOD/magic/Format tag at 1080 for the tag table. The 15-sample Soundtracker variant has no tag: see Fact:ProTracker MOD/identification/15-sample Soundtracker files have no tag.

Pattern cell

See Fact:ProTracker MOD/behavior/Pattern cell layout: 12-bit Amiga period, 8-bit sample number split over two bytes, effect nibble and parameter byte.

Pitfalls

  • Sample length, loop start and loop size are counted in 16-bit words, not bytes.
  • M.K. is not proof of 4 channels: Mod's Grave WOW files are 8-channel files that keep the M.K. tag, found only by computing the size expected for 8 channels (libxmp mod_load.c lines 706-728).
  • Software Visions DMF files (tag .M.K) have the first 2108 bytes word-swapped (libxmp mod_load.c lines 563-568).
  • Unverified: the exact meaning of each effect command is not documented here; see the ProTracker command list.

Code & repositories

libxmp (MIT) src/loaders/mod_load.c and st_load.c; OpenMPT soundlib/Load_mod.cpp (Unverified: not read for this page).

  • https://github.com/libxmp/libxmp @ 5d4f6aa2c7dcdf8e9cd8129fe579d45b36a302da · license: MIT (declared by the contributor; GitHub's detector did not recognize a license file)
    Extended Module Player library: loaders for MOD, Soundtracker, S3M, XM, IT and dozens of other tracker formats (src/loaders), with tracker detection heuristics.
    Tested on: source read, not run: read only, source files at the pinned commit · checked 2026-10-19; last activity 2026-10-10