Expand description
MIDI music: Standard MIDI Files with Apogee’s EMIDI extensions, played with the FM voices
in crate::fm and Blood’s AdLib timbre bank (GMTIMBRE.TMB in SOUNDS.RFF). Used for
a level’s Song= (BLOOD.INI) when no CD audio track was ripped.
EMIDI controllers handled (as publicly documented for Apogee’s sound system):
- 110 / 111 at the start of a track: include / exclude the track for a device
(OpenBlood plays the FM variants, devices
FM_DEVICES, or “all” = 127); - 112 / 113: device-specific program change and volume;
- 116 / 117: song loop start / end; 118 / 119: track loop start / end.
Without loop markers a song restarts from the beginning when every track has ended.
Structs§
Enums§
Constants§
- BANK_
SIZE - Melodic timbres 0-127, then one percussion timbre per key (128 + key).
- BLOCK 🔒
- Events are applied between blocks of this many samples (about 1.5 ms at 44.1 kHz).
- EMIDI_
ALL 🔒 - FM_
DEVICES - EMIDI device numbers treated as “this player”: Sound Blaster and AdLib (both OPL FM).
- MAX_
VOICES 🔒 - Voices sounding at once (the OPL3 has 18 two-operator channels).
- MIX_
GAIN 🔒 - Output gain applied to the sum of all voices.
- PERCUSSION_
CHANNEL 🔒
Functions§
- parse_
bank - Reads the 256 timbres of an AdLib timbre bank (
.TMB). - read_
varlen 🔒 - stream
- Streams a song as interleaved 16-bit stereo 44.1 kHz chunks (half a second each) from a
background thread, in the same form as
crate::cdaudio::stream_wav. The thread exits when the receiver is dropped. - track_
plays_ on_ fm - EMIDI track designation: whether a track plays on an FM device. Tracks without designation controllers always play.