Monthly Archives: March 2018

Another Star 2 Dev Log #22: The Shape of Music

As mentioned in previous dev logs, Another Star 2 uses a real-time software synthesizer to generate its music and sound effects as you play. This required me to program a special tool called FM Pipe Organ that I use to set up the sound of the “instruments” and actually compose each track. It’s a little buggy in places and lacks a lot of helpful tools that most composing interfaces provide, but it’s good enough that I’ve already put together quite a bit of music, some of which I’ve shared in past dev logs. Granted, there’s still a long way to go, but the music is already shaping up pretty well in my opinion.

In the early stages of developing the synthesizer, I’d get lots of audio pops and other artifacts. It’s hard—and, in some cases, rather impossible—to tell what’s going on just by listening. Thankfully, sound is a wave, so it’s fairly easy to represent as a winding line that maps the waveform over time. To debug the synthesizer early on I would record the output using whatever sound editing software I had on hand at the time, and then go peek back at what the waves looked like. I often continued to do this whenever I made a new instrument setting and was trying to get a specific shape for the waveform. Even back then, I realized how helpful it would be to have this capability inside FM Pipe Organ instead of having to rely on an outside tool.

FM Pipe Organ oscilloscope visualization

The hills are alive.

This past week I hastily added a handy little oscilloscope visualization to FM Pipe Organ. Not only does it show the final left and right audio output that’s sent to the system, it also displays the individual output of each of the eight channels. The visualizations for the individual channels do their best to show the actual timber of each sound by left-aligning the waveforms based on when they pass the zero-boundary while going upward. They further stabilize the waveform rendering by checking multiple passes through the boundary and choosing one based on how close it is to the one before it. This is really helpful for complex waveforms that pass the boundary multiple times in a single repetition and otherwise end up snapping back and forth a lot in the rendering. Sometimes this works and sometimes it doesn’t, but usually you can see the waveform pretty clearly. It gives a really good indication of what the channel is doing and why it sounds the way it does.

Below you can watch and listen to FM Pipe Organ in action, playing a song I specifically wrote to show off what it can do. It’s meant to be used in some of the early hidden areas you can explore, but we’ll see how it ends up used in the final game. It may even end up sounding quite different in the end. Pardon any frame skips or audio pops in the video; they aren’t normally present when I’m not trying to use capture software.

If you watch carefully, you’ll notice that the bottom two channels, channels seven and eight, never do anything. That’s because Another Star 2 only uses six of the eight channels in an attempt (possibly in vain) to avoid sounding too much like a later 16-bit console game. I haven’t fully decided what the limitations for the game’s soundtrack are going to be, but that one in particular is pretty firmly set at this point.

One day, I’ll publicly release FM Pipe Organ for sure, so that everyone who is interested can play around with it. However, I don’t see that happening until after the game itself is released. Like a magician, I don’t want to give away all my secrets in the middle of the show!