Explorer’s Lab › Orbit Lounge › Build log
Build log
Gate clack sound
The launch-lane gate flap now clacks each time it knocks a stop: a slap as the ball throws it open, then fading clacks as it settles.
Goal
Derek accepted my suggestion of a “clack” to go with the new gate flap (see 2026-11-26-launch-gate-flap.md).
What was done
- The sound:
gate(strength)insrc/game/audio.ts, synthesised like the other effects with no audio files. It’s a short band-passed noise tick at about 3.6 kHz, two quiet triangle partials (2.35 and 3.31 kHz) for a brief metallic ring, and a small low thunk for body. Strength 0–1 scales it, and the pitch varies by ±6% so the knocks don’t sound identical. - The trigger: the gate’s pendulum in
src/render/scene.tsreports each knock through a newonGatehook:- hitting the open stop (strength = flap speed ÷ 45 rad/s);
- hitting the closed stop (speed ÷ 28 rad/s);
- very soft touches are skipped.
main.tspasses these to the sound.
- Mixing: it goes through the same wrapper as every effect, so the Sound effects switch silences it. It doesn’t duck the music.
DESIGN.mdgate section updated.
What broke / dead ends
Nothing. ffmpeg isn’t installed, so the preview recording stayed as WebM, and its levels were measured by decoding it in Chrome instead.
Human interventions
Derek said yes to the sound.
Verification
npm run typecheckpasses.- Headless Chrome, real plunges:
- a full plunge gave four clacks, at 0, 99, 266 and 432 ms (strengths 0.81, 0.97, 0.29, 0.09);
- a half plunge gave three, at 0, 167 and 333 ms (0.9, 0.27, 0.08).
- Recorded the real audio output (Web Audio → MediaRecorder) for the same patterns, with a plunger sound before each, and decoded it. The plunger peaks at −17 dB; the clacks peak at −23, −20, −31 and −42 dB (full plunge) and −23, −32, −44 dB (half). So the clacks sit a little under the plunger and fade out. The recording was sent to Derek to listen to.
- No console errors.
npm test,npm run buildandnpm run check: all pass. - Not verified: listening on real speakers or a phone (I can’t listen), and how it sits under the music.
Next steps
Derek to listen and say whether it should be louder, softer or duller.