Measuring the soundtrack
The brief for asdf’s audio is printed on its own title screen: sound on is strongly recommended. A four-key arcade game carries neither narrative nor dialogue, so the atmosphere rests entirely on the soundtrack, and the two songs I generated for it, “Neon Noir” and “Neon Pursuit”, turned out considerably better than I had any right to expect. The real work began afterwards, because a game full of chimes, hums and collisions has to live inside music I didn’t write.
The clash problem
Every gate, jump and crash in the game produces a pitched sound, and pitches chosen carelessly grate against whatever the song happens to be doing at that moment. The conventional escape is to synthesize every effect from filtered noise, which is safe and joyless in equal measure. I wanted bells. Bells have notes, and notes can be wrong.
Measuring what I didn’t write
A composer knows what key their songs are in; I had two MP3 files. So the repository contains a small measuring instrument: a script that decodes both tracks in a headless browser, runs Goertzel filters over twelve pitch classes across four octaves, and correlates the resulting chroma profile against the Krumhansl-Schmuckler key templates that music-information researchers have relied on for decades. “Neon Noir” identified itself as C major with genuine confidence. “Neon Pursuit” came back D minor, approximately, with a third too ambiguous to call.
Five shared notes
I turned that ambiguity into the design. The effects for the C major track use the C major pentatonic scale, while the D track gets a sus pentatonic on D, a scale with no third at all, so the question the measurement couldn’t answer never needs answering. Better still, the two scales spell out an identical set of five pitches, C, D, E, G and A, so a single pool of notes serves both songs at once. The tracks alternate for as long as you survive, joined by a fourteen-second equal-power crossfade, and in the middle of that overlap both keys are sounding simultaneously, which is exactly the moment the shared pool was built for.
Everything sits on the scale
The engine hum is quantized to the nearest scale tone, so accelerating climbs real steps of the song instead of gliding chromatically against it. The gate chime walks up the scale with your combo and wraps after two octaves, gaining a second voice a fifth above from combo four onward, while jumps sweep from root to fifth and the pulse drops a full octave onto the root. A quiet arpeggio rides on the music bus, silent while you cruise, then denser and higher as a streak accumulates. Reward the player and the soundtrack itself blooms; crash, and it ducks with the music before the two of them return together.
The transition that died
The first crossfade design was clever: a filter blend that would sweep each incoming track in from the bass upward. In practice the filter swallowed the new song’s opening seconds and left an energy hole precisely where the game had just promised momentum, so it got cut for two plain gain curves, cosine out and sine in, summed power constant the whole way through. Nobody hears the transition now. That is the compliment.
The honest part
I didn’t write the songs, and I didn’t write the code alone either; the colophon of this site says plainly how I build with machines. What belongs to me are the decisions: measuring the music rather than guessing at its key, letting an ambiguous third choose the scales, keeping every effect on five shared notes, cutting the clever transition the moment it fought the game. The songs are half of asdf. The decisions around them are the other half, and they are the half I can put my name on.