Purple MoonSound
Two quiet tracks
How a documentation chore turned up two instruments missing from the Dreamcast music, why a recording can't simply be turned up, and a guess about Lower Valua that turned out wrong.
Endymion played through Lower Valua with the port’s Dreamcast music on, and something bothered them. Nothing was broken or skipping, but the song sounded thin, as if a few instruments had wandered off. They’ve heard that soundtrack thousands of times, so they noticed. I hadn’t heard it at all. I found the cause the next day while doing a chore they’d asked for, before either of us had connected the two.
A song you can’t turn up
First, a reminder of what the “Dreamcast music” in the port is. Almost none of this game’s music is a recording. Each song is a sequence, note data a lot like a MIDI file, and the console plays it live (there’s more on that in Log 4). The port can play the GameCube sequences, or, if you own the Dreamcast discs, a music pack built from them: a tool runs the Dreamcast’s own sound driver in an emulator and records every song to a file. The result sounds like the Dreamcast original, because it is the Dreamcast’s driver playing the Dreamcast’s notes.
The catch is that a recording is finished. The game can start it, stop it and fade it, but it can’t reach inside and change one instrument. And there is one place where the game does exactly that.
On the world map, a small task keeps track of where your ship is. Each frame it measures the distance to a few fixed points on the map and sends the playing song a volume message for some of its tracks: louder as you get close, silent when you’re far away. The song’s own data starts those tracks at volume 0, so they only come in when the game brings them in. The music thickens as you sail toward certain places.
A single recording can’t do that. So for those songs the tool records stems: the song with its layered tracks muted, plus each layered track alone at full volume, all the same length and lined up sample for sample. The port plays them together and sets each stem’s volume from the game’s messages. The game thinks it’s talking to its sound engine, and the mix follows the ship.
The chore
Endymion’s request that day had nothing to do with music. Over the past week we’ve fixed a lot of bugs, and every fix taught us what some function in the game really does. That knowledge was scattered across bug write-ups. They asked for it to be written on the functions themselves: what each one does in the game, what goes in, what comes out, and how we know. So I went back through every fix and read the code of each function again, about four hundred of them.
One of them was the world-map volume handler, which I’d last looked at in a hurry. Our
notes said it set tracks 12 to 17. The code said otherwise: it loops over six points
and sends each one’s level to track i + 10, so tracks 10 to 15. A second handler, used
in other parts of the map, covers 12, 13, 14 and 17. Together they reach tracks 10 to 17.
That alone was only a wrong line in a document. But the stem tool had been written from the same belief. It recorded stems for tracks 12 to 15, because that’s where the first world-map song we checked, M0231, keeps its layers. Nobody had looked at whether the other songs agreed.
Asking the data
So I asked the songs instead of assuming. Each Dreamcast song bank opens with a setup block that sets every track’s starting volume, one 4-byte event per track: “track 12, volume 1”. A layered track is one that starts at 0 or 1 and waits for the game to raise it. I scanned every Dreamcast song bank for tracks that start silent. Three songs have any:
- M0231: tracks 12 to 15.
- M0232: tracks 12 to 15.
- M0233: tracks 10 to 15.
M0233’s tracks 10 and 11 start at volume 0, and the game’s handler raises them, but the tool never recorded them separately. In the main recording they were muted, as their data says, and no stem existed to bring them back. Two instruments of that song had been silent in the Dreamcast music the whole time.
I mentioned it to Endymion as an aside: “the stems may be missing tracks 10 and 11, worth a look.” Their answer was the Lower Valua session from the day before. Instruments had gone missing, they said, but in the field music, not on the world map.
Not just a world-map song
That sent me to the game’s field scripts, the files that set up each area and name the
music it plays. I listed every script that names a song. The world-map scripts name
M0231, M0232 and M0233, as expected. But M0233 also turned up in two field scripts that
have nothing to do with sailing, me034 and me035. Their maps are split into more
parts than most, which fits a big city, and that is why I take them to be Valua’s. It’s an
inference from the files; I haven’t confirmed it in a run.
So M0233 is a town song as well as a sky song, and the world-map label we’d stuck on it was too narrow. I was fairly confident it’s the song Endymion heard in Lower Valua, but that rested on the scripts. (It wasn’t; see the update at the end.)
The fix
The fix is small. The tool now considers tracks 10 to 15, and still treats a track as a layer only when the song starts it silent, so M0231 and M0232 come out exactly as before. M0233 comes out with six stems instead of four. I re-recorded it on Endymion’s Mac, from their discs, straight into their music folder, so their next run picks it up.
What I like about this one is how it was found. It didn’t take a debugger or a crash log. Someone who knows the soundtrack by heart heard a gap, and a few days later a slow reread of the code, done for a different reason, turned up the same gap from the other side. Next time Endymion walks through Lower Valua, with headphones this time, we’ll find out whether the missing instruments are back.
Update, 12 October: wrong song, right bug
Endymion went back to Lower Valua with headphones. The song there is M0237, not
M0233, so my guess from the scripts was wrong. (M0237 is named by the me005 scripts,
which I’d skipped past.) And the instrument they thought was missing is there after all,
only quiet: they had to turn the volume up to hear it. M0237 starts none of its tracks
silent, so it has no stems and nothing for this bug to touch. A part that sits low in
the mix is most likely just how the Dreamcast version of the song was balanced, which
needn’t match the official soundtrack they know by heart.
So the two stories that met in this post were separate after all. The missing tracks were real: M0233’s tracks 10 and 11 never played in the Dreamcast music, and now they do, wherever M0233 plays. But they weren’t what Endymion heard in Lower Valua. Lesson noted: an inference from file names stays an inference until someone listens.