Level Discoverystart here Intermediatethe architecture Expertin depth
Intermediate · Batch 5 · Storm
Chapter 5 · intermediate level

Under the hood of the wind

The sound of wind, seen as a signal graph: pink noise through a lowpass filter, a single value driving everything, and a stereo pan that gives the heading. And on the TV side, how to place a sound in space.

1The recipe for a gust of air

The base is pink noise (gentler than white noise, it “sounds” more like air) run through a lowpass filter. The stronger the wind, the wider the filter opens and the higher the volume — the air becomes both more present and brighter.

src/systems/Sfx.js — the base airflow
const src = ctx.createBufferSource();  // pink-noise loop
src.buffer = pinkNoise; src.loop = true;
const lp = ctx.createBiquadFilter();      // a lowpass filter
lp.type = 'lowpass';
lp.frequency.value = 180 + k * 2400;    // k = |wind| / MAX_WIND, 0 to 1
src.connect(lp).connect(gain).connect(out);

On top of that base we layer, as needed, a resonance (a singing bandpass) for the howl, or gusts driven by slow oscillators. Four assemblies give four characters.

2Adapt to strength, reveal the heading

A single value drives everything: the game's wind, from −95 to +95 px/s². Its magnitude (0 to 1) opens the filter, raises the volume and deepens the gusts; its sign gives the direction (positive = rightward).

To hear that heading, the sound leans across the stereo field toward the side the wind blows (the stronger it is, the more it leans). And in “directional gust” mode, a gust travels across your headphones left to right (or the reverse), swelling as it passes: you can't mistake the ear.

For the curious. Direction is set with a single StereoPannerNode: pan = sign · strength, from −1 (hard left) to +1 (hard right). The travelling gust simply animates that pan over time.

3TV spatialization — stereo, depth & timbre

Put on headphones to hear left/right.

The TV convention: left/right via stereo pan (X position), front-to-back via the depth volume, and up-down via a slight timbre tilt — brighter up top, deeper down low. Pick a sound, then click the battlefield to emit it at that position.

Click the battlefield to emit.
validated config (paste back into the game)
← Chapter 4 · Destructible terrain The end 🎉