Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OPL and AD instrument banks

OPL and AD files store Miles FM synthesis timbres indexed by MIDI patch and bank.

The sound directory contains sample.opl, Fatman.opl, sample.ad, and Fatman.ad. Each AD bank contains the same bytes as its matching OPL bank. These banks provide two-operator instrument settings for FM MIDI playback. See also Miles DOS drivers.

The shipped game disables Miles MIDI initialization. These banks belong to the bundled FM MIDI system. Background music uses CD audio and does not use the banks.

Overall Structure

[Instrument index — patch and bank identifiers with file-relative offsets]
[Index terminator — FF FF]
[Timbre records — two-operator register settings]

All multibyte integers are little-endian. There is no file signature or instrument-count field.

Instrument index

Each entry is six bytes.

OffsetSizeTypeNameDescription
+0x001u8patchMIDI patch identifier
+0x011u8bankBank identifier
+0x024u32offsetAbsolute file offset of the timbre record

The index ends when both identifiers are 0xFF. This terminator is two bytes and has no offset field. Timbre offsets must point beyond the complete index. Entries may share a timbre offset; record ordering need not match index ordering.

Timbre record

The two-operator record is 14 bytes, including its size word.

OffsetSizeTypeNameDescription
+0x002u16sizeRecord size, 14
+0x021i8transpositionMelodic pitch adjustment or percussion note
+0x031u8modulator.reg_20Operator characteristics and multiplier
+0x041u8modulator.reg_40Key scale level and total level
+0x051u8modulator.reg_60Attack and decay rates
+0x061u8modulator.reg_80Sustain level and release rate
+0x071u8modulator.reg_e0Waveform selection
+0x081u8reg_c0Channel feedback and connection settings
+0x091u8carrier.reg_20Operator characteristics and multiplier
+0x0A1u8carrier.reg_40Key scale level and total level
+0x0B1u8carrier.reg_60Attack and decay rates
+0x0C1u8carrier.reg_80Sustain level and release rate
+0x0D1u8carrier.reg_e0Waveform selection

For melodic channels, transposition adjusts the incoming note. On the percussion channel it supplies the note directly.

Register values are stored bytes, before playback adjusts pitch, volume, or channel assignment. The two-operator layout described here uses 14-byte timbre records. The banks contain synthesis parameters rather than recorded samples. Modern playback of the game’s sound effects and dialogue uses the audio in SFX and RTX.

External References