The 90s were the golden age of personal computer music… and if you owned a PC compatible computer, the Sound Blaster card was a must as it was capable of producing both FM synthesis and digital music.
The YM3812 (also known as the “OPL2”) chip was responsible for the FM synthesis music in the Sound Blaster... let’s recreate a YM3812/OPL2 in an FPGA.
You will need
We are going to program the FPGA with a RS232 receiver, an OPL2 core named JTOPL and a PWM generator.
Here we use a Pluto-IIx XC3S200A board but any medium size FPGA board should work.
Compile and load the "OPL2_demo" module in your FPGA, then run a VGM file through the VGM2COM player.
The FPGA files are available here and the VGM2COM player here.
How does this work? VGM files contain the exact list of commands to send to a sound chip to play a specific tune.
Let's look at a YM3812 VGM file with an HEX editor.
Starting at address 0x60, we can see all the YM3812 commands.
You can find a lot of VGM files on the OPL archive site.
The music files are playable right on the site and are also available for download.
You might get a VGZ file but it is simply a compressed VGM: open the VGZ file in WinRar (or your favorite compression software) to un-compress it to a VGM.
Note that not all the files on OPL archive are targeted for the YM3812... but about half of the files are (they are marked "OPL2"). Another site with a lot of VGM files is VGMRIPS and if you want only the files targeting the YM3812, go here.