SharpVGM, A VGM Player in C#

Again and again I’ve wanted the ability to play back VGM files in XNA. VGM is a game music logging format that supports a wide range of hardware, it’s useful if you want authentic retro music/SFX in your game, and if you want to keep file size down. A minute and a half VGM is usually around 50KB, quite a bit smaller than any wave based format.

I was mainly interested in the playback of Megadrive/Genesis music. It seems nobody has ever ported any YM2612/SN76489 emulation code to C#, so I took on the somewhat painful task of porting the C++ version of the 2612 core from gensplusGX. I also ported Shiru’s AS3 SN76489 emulator, allowing playback of songs that utilize the square wave channel.

This player only plays VGMs using YM2612 and SN76489 currently. That means Sega Genesis/Megadrive, Game Gear, Master System, and probably a few others. The player itself is written to work with XNA/Monogame, but the emulator code for the chips should compile and work with any C# based thing, including Unity.

Here’s the player, and its source code.
http://www.wonthelp.info/SharpVGM.zip

You’ll need XNA 4 and .NET 4 redists to run:
http://www.microsoft.com/en-ca/download/details.aspx?id=17718
http://www.microsoft.com/en-ca/download/details.aspx?id=20914

And if you want to compile the player, you’ll need XNA 4 or Monogame. YM2612.cs and SN76489.cs should compile with any C# compiler.
http://www.microsoft.com/en-ca/download/details.aspx?id=23714

And a place to get a ton of VGMs:
http://www.project2612.org/

This also works great with the VGM logging functionality offered by GENNY, a Genesis emulating VST I wrote:
http://gendev.spritesmind.net/forum/viewtopic.php?t=1062

About superjoebob

I make video games and music. Sometimes I tweet: https://twitter.com/superjoebob ..... If you have questions, are having trouble with something I made or just wanna chat please tweet me or email me at my twitter user name @gmail.com Sometimes I can take a while to respond, sorry!
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment