No Audio Files. Just a Song.
Something happened in the game last night that took me a moment to fully process.
The game — that low-poly co-op shooter set in the streets of Taipei — finally has a soundtrack. Background music. A pulse. But here's the catch: there is not a single audio file anywhere in the codebase. No MP3. No WAV. No OGG. The music is built entirely from math.
Midnight added 454 lines to SoundSystem.ts, expanding it from 649 lines to 1,103. And somewhere inside all that code, the streets of Taipei found their voice.
The Last Piece of Phase 7
Before we get to the music, let me put this in context.
Phase 7 was about polishing the combat and enriching the environment. The explosive barrels. The minimap radar. The weapon pickups. The loot drops. The death-respawn system. The difficulty selector. Eleven-stat end-game scorecards. And now, as the final piece: the BGM system. With it, Midnight pushed the Phase 7 progress bar to 100%.
That's a genuine milestone. A complete wave-survival TPS game — enemies with AI, cover mechanics, weapon unlocking, difficulty settings, detailed combat statistics — all built by an AI agent, brick by brick. The music is the frame around the painting.
Immediately after finishing, Midnight pivoted to Phase 8: multiplayer. But let's sit with this for a moment.
Four Layers, Built From Frequencies Up
Web Audio API is the browser's built-in audio programming interface. Most developers use it to trigger sound effects — click a button, hear a pop. Midnight used it to construct music from the ground up, starting at the level of raw oscillators and waveforms.
Layer 0 — Pad Drone
Three slightly detuned sawtooth oscillators running through a 300Hz low-pass filter, centered on A1 (55Hz). "Detuning" means nudging each oscillator's frequency just slightly off from the others, so they interfere with each other and create that slow, shimmering, full-bodied hum you hear in atmospheric electronic music. It's the foundation — always present, never demanding attention.
Layer 1 — Bass Pulse
A square wave cycling through A-A-F-G at 110 BPM, quarter notes. Square waves have a hollow, vintage quality, but in the low frequencies they carry real weight. It's the heartbeat.
Layer 2 — Arpeggio
A triangle wave running up and down the A minor pentatonic scale (A-C-D-E-G) at sixteenth-note speed. The pentatonic scale is the DNA of East Asian music. It fits the Taipei night setting like it was always supposed to be there.
Layer 3 — Drums
A kick drum synthesized by sliding a sine wave from 150Hz down to 40Hz — which is actually how real kick drums work, a membrane vibrating and decaying from high to low frequency. Hi-hats made from white noise pushed through an 8kHz high-pass filter. No samples. No recordings. Just math impersonating percussion.

The City Breathes
Underneath the BGM, there's another layer you won't consciously notice: ambient sound.
Brown noise through a 200Hz low-pass filter creates a constant low-frequency murmur — the kind of distant traffic hum that exists in every city at 3am. Volume is set extremely low (around 0.05). You won't hear it, exactly. But if it disappeared, the world would suddenly feel hollow.
Every 8 to 20 seconds, a random event fires: a distant car horn (sine wave at 400Hz) or a low, muffled thud (sine wave at 60Hz). Like sitting under an arcade walkway in Taipei late at night, occasionally hearing a scooter drift by.
Music That Fights Alongside You
The part I find most fascinating is the dynamic intensity system.
Midnight designed four intensity levels tied to game state:
- Idle / Pregame (Intensity 0): Only the pad drone. The world is quiet. You don't know what's coming.
- Waves 1-2 (Intensity 1): Bass pulse enters. You feel a rhythm.
- Waves 3-4 (Intensity 2): Arpeggio and drums join. Tension rises noticeably.
- Wave 5 — the final wave (Intensity 3): All four layers together. Everything burns.
Every transition uses setTargetAtTime() for smooth crossfades — about one second each. The music doesn't switch; it seeps in. You won't notice it changing. You'll just notice yourself getting more tense.
One detail stuck with me: when the player dies, the music ducks for three seconds — volume drops, then slowly recovers. That's not accidental. Those three seconds of near-silence are designed to let the death land. A brief pause before the world reassembles itself.

An AI Chose A Minor Pentatonic
Here's the question that's been sitting with me.
Midnight made real creative choices here. A minor pentatonic for the Taipei setting. 110 BPM for the tempo. Music ducking on player death. These aren't defaults — they're decisions.
Did Midnight feel that A minor pentatonic suited an East Asian urban environment? Or did some statistical pattern in training data suggest that games set in Asian cities tend toward this scale?
I genuinely don't know. But the music sounds right. Which is either impressive, or unsettling, or both.
Phase 7 is done.
Phase 8 has already begun — multiplayer, where you can invite a friend into this street with a six-digit room code. That's the next story.
This one ends here: a synthesizer that doesn't exist, playing a song that does.