Frogbull Breakthrough Demo Paves the Way for Sequenced Music in Homebrew Saturn Games

One of my white whales in Sega Saturn homebrew game development has been sound and music. Starting out on Jo Engine, I quickly found out that the sound functions didn’t quite work, leading to several dead silent games.

Later, Ponut64 released ponèSound, enabling things like uncompressed sound effects and CDDA audio — basically, playing the disc like a music CD for background music. This is generally enough to get a game off the ground with a full feature set, but the considerations for music mean that you can’t really load anything while the music is playing. Annoying, but workable.

But back in the day, not every game worked like this. Many Saturn games featured sequenced audio: Basically, descriptions of musical notes and timing, like MIDIs, that could be stored in a much smaller space than full-on uncompressed audio. These sequenced music tracks could fit comfortably in the half megabyte of sound RAM, freeing up the CD to do other things, like load more level geometry or even just having a non-silent loading screen (go back into your library and check, this usually isn’t the case).

Earlier this year, Frogbull stealth released a demo on GitHub and on his Patreon featuring sequenced music playback inside of the Saturn Ring Library. I was able to talk with Frogbull to ask about the technology and future direction of this demo.

Playing MIDI music on the Saturn

But first, a quick primer on sequenced music on the Saturn. Sequenced music playback on the Saturn requires three parts loaded into sound RAM. First, the tone (TON) file containing samples of the instruments and related metadata for playback. Then, a sequence file (SEQ) that can contain one or several songs composed of descriptions of notes, duration, and timing. Finally, the map (MAP) file that contains a description or summary of memory locations for the various instruments and songs loaded into sound RAM.

For this demo, Frogbull chose to reuse old TON files extracted from official Saturn games. Sequences get a bit more involved. Nominally, the restrictions are that sequences are generated from Format 0 MIDI files. Normally, a Saturn developer in the ’90s would have a Macintosh program to generate and export SEQ files based on MIDIs.

The sequence files that contain Stellar Assault SS’s music.

Today we have CyberWarriorX’s Seq2Mid and jfsantos’ Mid2Seq. The current restrictions on what will allow a SEQ to playback are opaque, but Frogbull advised taking your MIDI, running it through Mid2Seq then back through Seq2Mid. If your song can survive the round trip and be played on the computer, it’s probably OK to play on Saturn.

For the MAP file, Frogbull has a Python script that generates a custom MAP based on the planned TON and SEQ file used. In this way, you would have to reload all of sound RAM for every new song, though that footprint can be kept small with good planning.

“It’s very quick to load a new SEQ/TON into the sound RAM,” he explained. “In classical Saturn you have several TON/SEQ loaded at once.”

For the time being, loading in a song at a time can still result in a footprint of around 250 kB that you flush and reload when you want to play a different song. The bulk of that space is the TON file, composed of the equivalent of uncompressed PCM/WAV sound for each instrument. The custom MAP file takes into account the biggest TON and SEQ file you plan to load.

“I always go for barbarian easy solution, not enough brain-power and time for the complex one,” Frogbull said.

As far as I can tell, this is a picture of Frogbull about to tackle another programming challenge.

The future

There’s still a lot more work to do to simplify the tracker/MIDI-to-sequence pipeline and a script to construct tone files based on instrument samples. “Once all the main bricks will be ready to use it will be very easy to use,” Frogbull told me.

Frogbull plans on eventually releasing a more mature tool suite — something that I can say will likely serve a crucial role in the Saturn homebrew world once available.

“My ultimate goal is to have a complete open source toolkit to handle all the [stuff] easily and don’t worry about it in the future,” Frogbull said.

For the time being, I will continue to monitor his progress closely, so keep checking SHIRO! for a followup to this story, where hopefully I will have another chance to talk to Frogbull about his music tools, and maybe even go through the music pipeline to get successful music playback during a livestream.

About the author

Emerald Nova

Physicist by day, Saturn homebrew game developer in the early AM. Sometimes streams development on Twitch. Personally trying to fix the North American Saturn game library by making the RPGs that no one else bothered to.

Be the first to comment

Leave a comment

Your email address will not be published.


*