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:Doom MUS

From ReverseEngineering.wiki
Format
Magic MUS 1A at 0
Extensions (WAD lumps D_*)
Endianness little
On this wiki Facts · Code · Notes · Topics

The music format of Doom and the other id/Raven Doom-engine games (D_E1M1 style lumps in the WAD): header "MUS" 0x1A, a score start offset, then one-to-three-byte events with a 7-bit-per-byte delay at the end of each group; always converted to MIDI (event for event) before playing.

Overview

MUS is a compact MIDI-like score for the OPL2/GENMIDI synthesis of Software:Doom (Format:WAD (Doom engine) lumps whose names start with D_). Source ports convert it to a Format:Standard MIDI File in memory, e.g. chocolate-doom's mus2mid.c.

Header

See Fact:Doom MUS/struct/MUS header: the id MUS 0x1A, then 16-bit little-endian score length, score start, primary channels, secondary channels and instrument count; the score data starts at the score start offset.

Events

See Fact:Doom MUS/behavior/Event descriptor and time delay. Channel 15 is percussion and becomes MIDI channel 9; the other MUS channels are assigned MIDI channels in order of first use.

Timing

Unverified: the delay unit is 1/140 second. The converter writes division 0x46 (70 ticks per quarter) into the MIDI header and never writes a tempo event, so a player uses the default 120 BPM, which gives 140 ticks per second (mus2mid.c line 74).

Pitfalls

  • The id check is compiled only with CHECK_MUS_HEADER (mus2mid.c lines 486-495); engines may not verify it.
  • Controller values above 0x7F are clamped to 0x7F by the converter (lines 316-326), a quirk of vanilla Doom data.

Code & repositories

chocolate-doom (GPL-2.0-or-later) src/mus2mid.c.

  • https://github.com/chocolate-doom/chocolate-doom @ e6f632a4397023b6b17cc312525a16b2aacd64d6 · license: GPL-2.0-or-later (declared by the contributor; GitHub's detector did not recognize a license file)
    Chocolate Doom: src/mus2mid.c converts Doom MUS lumps to a type-0 Standard MIDI File.
    Tested on: source read, not run: read only, mus2mid.c at the pinned commit · checked 2026-10-19