Turbo Pudding

LoudnikDev diary

How Loudnik plays its own songs

· The Turbo Pudding team · 5 min read

The Mirror Warden, a big gray mirror ball with a row of red lamps on top and one glowing pink tile, hanging from a clamp on a dark sky, pink dashed lines fanning down from it and green eighth-note shots flying up toward it

Out in the Airwaves, every planet is a radio station with its own song. Then Monotone, a conductor machine, decided there is only one right sound in the universe: a clean A at 440 hertz. Everything else is noise, so he switched the galaxy to silence.

In a game about bringing music back, the music can’t be an afterthought. Here is how Loudnik makes its sound, and why the whole game moves to it.

No tapes in the deck

There isn’t a single audio file in Loudnik. No recordings, no samples. Every note, drum hit and explosion is played live in your browser at the moment you hear it, built from a few simple waves and a little noise. Every melody was written for the game, note by note, as a score in the code.

The best part of doing it this way is that the game always knows exactly where the song is. It can tell which beat is playing right now, and that lets everything on screen move in time with it. More on that below.

A song for every station

Each stage song is a 16-bar score in two halves, A and B, eight bars each. But a song never just loops. It plays in a fixed order: a two-bar count-in, then A, then B, then A again with the melody doubled a third below, then B with a counter-line and a new lead voice, then a four-bar breakdown, and back to A. One round takes about a minute, so a stage of four or five minutes hears the whole thing four or five times without a seam.

Our rule was that you should be able to tell the stations apart with your eyes closed. So every stage has its own key, tempo, drum kit, groove and lead voice. Pirate Cove is the bright, heroic launch: E major at 150 beats a minute, with a square-wave lead, a plucked arpeggio and arcade drums. The Disco Rings swing: D Dorian at 128, a chirpy chip lead, slap bass, organ and a house beat full of claps. Bell Garden is weightless and quick: F Lydian at 140, a flute over running marimba and broken beats.

Volta’s ship, a white and purple arrowhead with green trim, flying up a dark purple sky with two fans of glowing green round shots ahead of it and yellow guitar picks floating around
The Disco Rings with the Chord tape loaded. Chord shots are drawn as round notes and fly out in fans. The yellow drops are guitar picks, the coins of the game.

The sound you hear most has to be the quietest

Your ship fires all the time, so its shot is the sound you hear most. If it were loud, the game would wear you out in a minute. So shots are short, crisp and quiet, and each tape has its own voice. Every shot comes out a touch higher or lower than the one before, so repeats don’t grate. And however fast a tape fires, its sound has a speed limit: Beat, for example, plays at most once every 0.075 seconds.

Solo is different. It’s a beam, not a stream of bullets, so it gets a held sound instead: one buzzing chord that hums for as long as the beam is on. It’s two waves at 110 and 165.4 hertz, and its brightness wobbles 22 times a second. The higher the tape’s level, the brighter the buzz. The low note is an A, two octaves below Monotone’s.

Volta’s ship firing a straight blue-white beam up a dark sky, a column of pink enemy bullets coming down beside it, the thin outline of a hanging bell between them and a bigger purple orb near the top
Bell Garden with the Solo tape. While the beam is on, you hear one long, buzzing chord instead of a stream of shots.

Picks that climb a scale

Coins in Loudnik are guitar picks, and they play a tune of their own. Grab a run of them and every second pick sounds one step higher, up a five-note scale: E, G, A, B, D, and on into the next octave, ten steps in all. Keep the run going and you can hear it climb. Stop for a moment, and it starts again at the bottom.

Everything moves to the beat

Since the game always knows the beat, it uses it everywhere. The background breathes a little on every beat. In the Disco Rings, the tiles of the floating dance floor light up in time, in a pattern that moves across the floor. On the title screen, every bar of the equalizer kicks on the beat. If the pulsing bothers you, there’s a No flashes switch in Settings.

The music reacts to you, too. Set off a bomb, and the song ducks out of the way for a second or so, so the blast lands. Pause the game, and the song doesn’t stop: it goes behind a wall, muffled, as if it were playing in the next room.

Color comes back in tenths

Monotone took more than the sound. Every station starts under his gray veil, washed out and dim. Each tenth of the stage’s enemies you shoot down brings another step of color back, and when the boss goes down, all of it returns. The first station ends with a line that sums it up: “The cove is playing again.”

Two halves of one picture: on the left, Volta’s ship over a washed-out gray Pirate Cove with dim relay towers; on the right, the same ship over a deep blue-purple sky with Beat shots ahead of it, pink enemy bullets and yellow guitar picks
Pirate Cove twice. On the left, the start of the stage, still under the gray veil. On the right, a minute later, with the color coming back.

The duel at the top

The picture at the top of this post is the Mirror Warden, the boss of the Disco Rings. “Monotone has turned its mirror ball into a warden’s searchlight.” The green eighth notes flying at it are Trill shots, which steer themselves toward the target.

Boss fights get their own song, called Jammers, and it’s written as a duel: D minor at 164 beats a minute, a brass lead against a buzzing counter-line, with deep bass and a choir behind them.

The first three stations are free to play in your browser at loudnik.com; the full game is $4.99, paid once. More about the game is on its Loudnik page.

More from the blog