.VOC / .XMI / SAMPLE.AD Documented

Caesar's sound files: .VOC, .XMI and SAMPLE.AD

Caesar's sound is off the shelf. The effects are Creative Labs voice files, the tunes are Miles Sound System Extended MIDI, and the drivers that play them are byte-identical to the Audio Interface Library 2.14 release, whose source its author released as freeware. None of these formats had to be reverse engineered; what had to be worked out is which file plays when.

Used by Caesar

What there is

The US build has 23 .VOC effects, 14 .XMI tunes with 14 matching .XM2 files, and one timbre library, SAMPLE.AD. Four loadable drivers (SBFM.ADV, ADLIB.ADV, SBDIG.ADV, PCSPKR.ADV) sit between them and the hardware.

The files

.VOC, 23 files
Creative Voice Files, a published format. Every one is 8-bit unsigned mono PCM in sound blocks, at 8 kHz or 4 kHz. On a Sound Blaster the game halves every sample's distance from 128 before it plays one.
.XMI, 14 files
Miles Extended MIDI (an IFF FORM XDIR / CAT XMID container; delays are summed delay bytes, there is no running status, and note-ons carry their durations). They convert to Standard MIDI at 120 ticks a second, and all 14 do. These are what the AdLib and Sound Blaster FM chip play.
.XM2, 14 files
The same tunes arranged for the PC speaker: the executable gives every tune the extension .xm2 when the speaker is the sound device.
SAMPLE.AD
The Global Timbre Library for the Yamaha YM3812 (OPL2): a directory of 6-byte entries (patch, bank, 32-bit offset) ending at bank 0xFF, each timbre a 16-bit length and, for the YM3812, 12 bytes: transpose, then the modulator's AVEKM, KSLTL, AD, SR and waveform select, a feedback and connection byte, and the carrier's five. 162 timbres, all 14 bytes; bank 127 is the rhythm channel's, one timbre per key, with the note it plays in the transpose byte. Every timbre any tune asks for is in it.
SBFM.ADV, ADLIB.ADV, SBDIG.ADV
Byte-identical to the Audio Interface Library 2.14 drivers of 14 November 1992. SBFM.ADV is its XMIDI driver for one YM3812. PCSPKR.ADV differs from the release (8,434 bytes against 8,377), an earlier or later version.

Which tune plays when

Nothing loops: every tune plays once. CZAR102.XMI is named nowhere in the US executable (inference: unused), and there is no CZARJIN3.

CZARTIT
The title screen.
STARTER
Entering the city after the start screen.
CZARJIN8
Drawing the Forum picture.
CZARJIN5, A, B, 6, 4, 9, 7
Each advisor's screen as it opens. CZARJIN5 is also the Options screen's.
CZARJIN1
Promotion.
EMPTUNE
The last promotion, to Caesar.
CZARJIN2
The arrest, when the governor has been dismissed too often.

The effects

Only one sound plays at a time: an effect stops the tune, and a tune stops the effect. ATTACK, CHARGE, FLANK and TORTOISE are named nowhere in the US executable (inference: unused, perhaps for Cohort 2).

RESPONSE
A construction command chosen.
DEMOL, FIRE, PUTOUT
A building demolished, set alight, or a fire put out.
WATER
A fountain running dry.
WAR_CRY, SWORD, BARBHORN
An invader or a rioter appears; the battle message; a Cohort reaching an army.
FANFARE, WINCHEER, WALLCOLL
A message; victory or defeat; the warning that the provinces need more workers.
MKT_THEA, COLISEUM, HORSES, HUBBUB, WORKSHOP, FOUNTAIN, MARCHROM, MARCHBAR
City sounds: a theatre, a coliseum, a hippodrome, a forum or a market, a workshop, a working fountain, Roman walkers and barbarians in view. They take turns on a 512-step cycle, and one plays only if its source is on screen.

Sources