In order to play music on most older consoles, the developer needs to supply a program (an "sound driver" or "sound engine" or similar) that will gradually step through a song, encoded as a sequence of notes and effects, and turn notes on and off as needed. Typically sound effects work similarly. The game usually has to actually supply this program itself (which, in the SNES's case actually runs on a totally separate processor!) and it can potentially be a lot of work especially when you take into account having to make tools for composing the music the driver can play. So it's nice to be able to avoid all of that.

On the SNES, Nintendo supplied a sound engine to licensed developers who then customized it to their own needs (Nintendo also supplied similar tools for the GBA and other platforms), but it would be copyright infringement for unlicensed developers to use it, so they have to use a homebrew-specific sound engine. Fortunately there are some preexisting SNES ones people have made (and I've listed them here). These generally don't have the same kind of capabilities as you'll get out of modern romhacking-oriented audio code, which is tainted from being based on Nintendo code.

I was previously using "SNES GSS" in my stuff, which is from 2014-ish, and includes a tracker for composing that lets you preview how the music will sound on a SNES right there. This is in contrast to SNESMOD which takes a tracker format that's not SNES-specific and converts it. And those were the two main choices I knew of until recently-ish? There's also qSPC which was used in a few games but it isn't really documented and the comments are in Japanese.

I ended up picking SNES GSS because I liked its sound effect support better than SNESMOD's (whose sound effect support is just playing samples and that's it) and I made a fancy version of it that added cool features and fixed some major design problems the original had, where it was possible for the game to just lock up, sometimes due to a quirk that emulators generally don't emulate.

There was never a newer version of SNES GSS released that fixed the locking-up issue, but there are patches for this (and for adding features like echo) but they work in a janky way because modifying how the driver works pretty much calls for recompiling the composing tools, and to do that you have to track down Borland C++. You can make an alternate song exporter like gsscli (and I attempted to write one in Python), but of course in the song editor you're stuck with the original features unless you modify and recompile that too.

Another SNES developer ended up making a driver named Terrific Audio Driver and I'm excited about it because it's got the nice traits SNES GSS has (SNES-specific music tools, sequenced sound effects) but the overall design of everything is much nicer (it's set up in an asynchronous way, where you have a queue of commands to send over; SNES GSS is built around sending a command over, then waiting for an acknowledgement. Remember that the audio driver is on a totally separate processor) and it's much easier to modify how the driver works while using the existing tooling. The asynchronous stuff is taken to the point where the code can handle loading audio in the background while you do other stuff, splitting the loading process over however many frames are needed. Some SNES games will just have the whole game pause while they load in audio, which can be slow on the SNES because of how it's designed (which means you have to send message to the audio processor with handshaking/acknowledgement of some sort; audio is very separate from everything else).

I recently went and changed my ongoing SNES project Nova the Squirrel 2 and my platformer exmple project to use TAD. It's still in development and the developer is planning on adding features that haven't really been seen in other homebrew drivers yet, like letting sound effects interrupt one of the music channels. That's very common in licensed games but I don't think any homebrew driver I've found supports it, aside from my custom SNES GSS version.

I guess all of this is kind of silly to get excited about but I want to make a lot of SNES stuff since it's my favorite console, and I'm happy to see the tooling get better and better.

Previous Post Next Post