Craig Iannello's WAV2VGM Makes Yamama OPL3-Compatible FM Chips Really Sing — or Speak
Yamaha's classic third-generation FM synthesis chips aren't just for MIDI any more, with this Python tool converting any digital audio.
Developer and vintage computing enthusiast Craig Iannello has built a Python tool for fans of classic computer audio — designed to take in a WAV-format audio file and spit out a Video Game Music (VGM) file that attempts to recreate it for the Yamaha OPL3 FM synthesis chip and compatibles.
"This (messy) utility for Python 3 takes an input WAV file and outputs it as a VGM file that uses OPL3 synthesis to recreate the original sound," Iannello explains of his project. "The method used is to convert the input sound to a spectrogram, then detect peak frequencies on the spectrogram and make a set of OPL3 instructions to play these peaks as a sum of pure sine waves of varying amplitudes."
The Yamaha YMF262 OPL3 FM synthesis chip launched in 1990, offering four-operator FM synthesis with twice the channels, stereo and four-channel outputs, four additional waveforms, and a harmonically richer sound than its predecessors. Found in vintage soundcards including later models of Creative Sound Blaster Pro and Sound Blaster 16, AdLib Gold, and Microsoft's own Windows Sound System (WSS) cards, the chips launched a market for compatibles from companies including Crystal, OPTi, and ESS — and the OPL3-and-compatible family remains much-loved by retro-gaming and digital music enthusiasts.
Iannello's tool is an unusual beast: where FM synthesis chips were traditionally used for MIDI music playback, the WAV2GM script turns digital audio into VGM-format OPL3 files — playable on original hardware or a range of emulators. These can include speech — which, while admittedly somewhat choppy, is definitely recognizable and a remarkable achievement for sound hardware designed with a very different task in mind.
Iannello has published the source code for WAV2VGM, complete with sample files, to GitHub under the permissive MIT license; "there is much room for improvement in this project," he admits, highlighting performance improvements, broader input format support, output file size optimization, and quality improvements as areas for future development.