MBM2MIDI
Simulates the MBM playback engine tick-by-tick at the original 50 or 60 Hz rate, capturing note-on/off events, instrument changes, and volume automation. Outputs a multi-track Type 1 MIDI file with separate tracks for each of the 9 melodic channels plus the sample channel.
- Tick-accurate MBM playback simulation
- 50 Hz and 60 Hz playback rates
- MSX-Music, MSX-Audio, or stereo chip modes
- Multi-track Type 1 MIDI output
- General MIDI instrument mapping
- Tempo and volume automation preserved
Usage
mbm2midi song.mbm
# Specify output file and 50 Hz playback
mbm2midi song.mbm -o output.mid --hz 50
# Convert MSX-Music channels only
mbm2midi song.mbm --chip msx-music --verbose
| Option | Description |
|---|---|
-o, --output <file> | Output MIDI file. Default: input filename with .mid extension. |
--hz <50|60> | Playback rate. Default: 60. |
--chip <mode> | Chips to include: msx-audio, msx-music, or stereo (both). Default: stereo. |
-v, --verbose | Show detailed conversion info. |
-h, --help | Show help and exit. |
Examples
mbm2midi song.mbm -o out.mid # → out.mid
mbm2midi song.mbm --hz 50 # → song.mid at 50 Hz
mbm2midi song.mbm --chip msx-music # → MSX-Music channels only
mbm2midi song.mbm --chip msx-audio --verbose # → MSX-Audio channels, verbose
How It Works
MBM2MIDI runs a complete simulation of the MoonBlaster playback engine. Rather than parsing patterns statically, it steps through the song tick-by-tick at the original interrupt rate (50 or 60 Hz), following the same speed counter, pattern sequencing, and command processing logic as the real MSX player routine.
Each tick, the simulator captures note-on, note-off, instrument change, and volume events. These are then mapped to Standard MIDI: MBM notes 1–96 become MIDI notes 24–119, MBM instruments are mapped to the closest General MIDI equivalents, and volume values are scaled to MIDI velocity and expression.
The --chip option controls which channels appear in the output.
In stereo mode (default), all channels are included. Use
msx-music or msx-audio to export only the channels
assigned to that chip.