Devlog #004 — Open-Sourcing Adaptive Music for Godot
We built a tempo-locked adaptive music system for Godot 4 — vertical layer blending and bar-quantised section transitions — and we've released it under MIT. It's the system PULSE//ZERO's music is moving onto, and it's yours to use in anything.
PULSE//ZERO’s soundtrack today is synthesised entirely in code — no audio files, every note generated from PCM at boot, the mix driven by the run’s intensity. (We’ll pull that system apart in its own devlog.) It still ships today. This entry is about where the music goes next, and about a small piece of Godot tooling we’re giving away.
We’ve open-sourced Adaptive Music (Godot 4), MIT-licensed: github.com/Northforge-Interactive/adaptive-music-godot
What it is
It’s a tempo-locked adaptive music player for Godot 4. Two mechanisms, both beat-matched.
Vertical — layer blending. A section is a set of stems that play
phase-locked. A single intensity value between 0 and 1 fades them in and out
against per-layer thresholds. Push intensity up and the track thickens — bass,
drums, arp, lead arriving in turn — then thins back down as things calm. It’s one
continuous morph rather than a switch, so there’s no transition to hear. It’s the
same intensity idea that drives PULSE//ZERO’s current score, now generalised into
a reusable component.
Horizontal — section transitions. Sections are mutually exclusive.
transition_to() crossfades from one to another, quantised to the next bar.
That’s what lets a boss theme — different harmony, different mood — drop in
cleanly over whatever was already playing.
Why quantise to the bar
The detail that makes the horizontal side work is the bar-line quantisation. A plain crossfade just overlaps two audio players; if their tempos or bar phases don’t line up, the overlap clashes and you hear the seam. By holding a single tempo across sections and only ever switching on a bar boundary, the two tracks overlap musically — the transition lands on the grid instead of fighting it.
Why release it
The synthesised score PULSE//ZERO ships today is a great fit for a single game,
but it’s deeply tied to the game’s own code. This addon is the opposite: small,
dependency-free GDScript that any Godot project can drop in. The repo is the
addon — copy it into addons/, enable the plugin, and AdaptiveMusicPlayer is a
global class you can instance or add as a node. Set a tempo, add sections and
layers, and drive set_intensity() and transition_to() from your game state.
One caveat worth repeating from the README: put a limiter on the target bus,
because summed layers can exceed 0 dBFS.
We take a lot from the Godot community. This is a small return — MIT, so use it commercially, fork it, strip it for parts. Issues and pull requests welcome.
As always: we build in the open.
- pulse-zero
- audio
- systems
- open-source
- godot