📚 Encyclopedia

Audio & Music · updated 2026-11-30

Adaptive game audio (mood crossfades and procedural sound)

game-audiocrossfadeprocedural-audioweb-audiogodotbrown-noise

Small games can get adaptive, responsive audio without a middleware engine: a two-track crossfade driven by one "intensity" value, plus procedurally generated effects. Used in Fall (Godot 4) and a vanilla-JS racer.

Two-track mood crossfade

Keep a calm track and an intense track playing in sync and map one 0..1 mood value to their volumes in decibels: calm lerp(-6, -40, mood), intense lerp(-40, -6, mood). Smooth the mood value frame-rate-independently (1 - exp(-3 * delta)) so the mix never jumps. In Fall, mood is the larger of fall-speed ratio and distance-from-center ratio.

Procedural sounds (no asset files)

Gotchas

See also

Linked from

Sources: fall memory (MEMORY.md, bugs.md), forge ai-activity (tldr post #1596)