Z Music Format

From ModdingWiki
Jump to navigation Jump to search
Z Music Format
Format typeMusic
Notation typeMIDI
InstrumentsDriver-dependent (OPL in reference setup)
Max channel countUnknown
Max track countUnknown
Max pattern countUnknown
Max order countUnknown
Tags?None
Games
Z

Music in Z uses Miles XMIDI sequences stored in IFF containers.

File format

Container chunk IDs and lengths follow IFF: four-byte IDs, UINT32BE lengths and even-byte padding. FORM, CAT and LIST containers carry a four-byte type. A FORM of type XMID can contain EVNT event data and a TIMB timbre list.

Events

Bytes below 0x80 add delay ticks. MIDI status bytes introduce events; program change and channel pressure have one data byte, other channel messages have two. Note-on messages append a variable-length duration; the reader schedules the corresponding note-off. Meta and system-exclusive payloads use variable-length lengths. The viewer uses 120 ticks per second.

TIMB has a little-endian entry count followed by patch/bank byte pairs, as consumed by the Miles driver. Resolve these against the timbre bank.

Notes

The viewer plays the first sequence for one traversal, capped at two minutes. It omits interactive branches and FOR/NEXT loops; its output is not evidence that those events are absent. Music synthesis is approximate.

Source code

From re-z, the open-source browser port:

Credits

The identification and implementation notes above were contributed by VorticonCmdr. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)