Repolode
emef2247

emef2247/x68k_vgm2mml

Python tool that converts VGM sound-chip register logs for X68000 into structured MML and PCM IR, with optional MDX/PDX compilation.

Stars
13
Forks
0
Open issues
0
Last commit
2 days ago

What is it?

x68k_vgm2mml reads VGM files, which record writes to sound-chip registers rather than notes, and reconstructs pitch, duration, volume and timbre information. The output is structured MML for the MDX format used on the Sharp X68000, along with PCM intermediate representation data.

It covers a range of chips, including OPM (YM2151), OPNA (YM2608), PSG/SSG, SCC, DCSG (SN76489 family), MSM6258-style PCM, SegaPCM and C140. Chips without a direct OPM equivalent are approximated by projecting their sound onto OPM FM or additive-synthesis voices, and PSG can alternatively be routed to PCM.

A batch script, export_mdx.py, can convert a directory of VGM files and also invoke external MDX and PDX compilers such as MXC or mmlx and soundlog. A --force option skips unsupported elements with diagnostics, and --no-song-loop produces a single pass instead of a looping song. Conversion does not guarantee a match with the original audio, so output should be checked on real hardware or an emulator.

Key features

  • 01Extracts notes, duration, volume and timbre from VGM register writes.
  • 02Outputs structured MML for X68000 MDX playback.
  • 03Approximates OPNA, PSG, SCC and DCSG sounds on OPM voices.
  • 04Generates PCM intermediate representation and PDX data for PCM chips.
  • 05Batch-converts a directory with optional diagnostic-based skipping.

Use cases

  • Converting VGM game or music rips into MDX files for X68000 players.
  • Studying how chip register sequences map to MML performance data.
  • Preparing PCM samples and PDX banks for X68000 sound playback.

Quick start

  1. 1

    Use Python 3.10 or later

  2. 2

    Generate MML from a VGM file

    python vgm2mml.py INPUT.vgm --outdir OUTDIR
  3. 3

    Batch-convert a directory to MML and MDX/PDX (requires an external MDX compiler)

    python scripts/export_mdx.py INDIR --outdir OUTDIR --force

Things to know

  • MDX/PDX output requires external tools such as MXC or mmlx, which need separate setup.
  • Converting between sound chips involves approximations, and compiled output is not guaranteed to match the original audio.
  • PCM playback requires a matching PCM extension driver, and some inputs may fail due to memory or size limits.

Topics

#vgm#mml#x68000#retro-computing#audio-conversion#music#python

FAQ

What is x68k_vgm2mml?
Python tool that converts VGM sound-chip register logs for X68000 into structured MML and PCM IR, with optional MDX/PDX compilation. x68k_vgm2mml reads VGM files, which record writes to sound-chip registers rather than notes, and reconstructs pitch, duration, volume and timbre information. The output is structured MML for the MDX format used on the Sharp X68000, along with PCM intermediate representation data.
Is x68k_vgm2mml free to use? What license does it have?
x68k_vgm2mml is open source under the MIT license. Check the license terms before using it in commercial products.
Is x68k_vgm2mml still maintained?
Actively maintained. The last commit to x68k_vgm2mml was on Nov 5, 2026.
What can I use x68k_vgm2mml for?
Converting VGM game or music rips into MDX files for X68000 players. Studying how chip register sequences map to MML performance data. Preparing PCM samples and PDX banks for X68000 sound playback.
How do I install x68k_vgm2mml?
Use Python 3.10 or later Generate MML from a VGM file: python vgm2mml.py INPUT.vgm --outdir OUTDIR Batch-convert a directory to MML and MDX/PDX (requires an external MDX compiler): python scripts/export_mdx.py INDIR --outdir OUTDIR --force
Where can I get x68k_vgm2mml?
The source code and installation instructions are on GitHub: https://github.com/emef2247/x68k_vgm2mml

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects