Repository navigation
[3/3] feat: synthesize the effects and loops with Web Audio - #121
Merged
Merged
Conversation
Decision 14 keeps audio out of Git, so every sound is a recipe of oscillators and filtered noise played at runtime: the docs/07 effects, one ambient loop per slice region and Jenny's loop. Hits, defeats, the boss and region turns are wired to the game events; game code calls sound.play() for the rest.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 23, 2026
3 tasks
arudaev
marked this pull request as ready for review
October 23, 2026 21:38
F7 plays the effects one by one and F6 cycles the loops in dev builds, so the sound can be checked with headphones before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Every sound in the slice, synthesized at runtime with Web Audio – no audio files, so decision 14 (no audio in Git) holds and nothing needs a licence. Alexander's call on #71.
fx/sound/recipes.ts): footsteps (girder, grass), chair whoosh + hit, rover motor, crab servos, drone hum, Jenny engine + crash, fluid absorb, the crash-dialog ding, player hurt, enemy defeated. Each is a few voices – oscillator or filtered noise, pitch glide, envelope – as plain data.fx/sound/loops.ts): Hidden Garden (wind, pad, birds), Rusty Creek (water, steel hum, girder ticks), Jenny (140 bpm kick, hats, saw bass). Bars are scheduled 0.5 s ahead of the audio clock, so a slow frame never gaps them. The anomaly state plays the region loop 6 % flat.Audioscene (fx/sound/Audio.ts, registered first inLANE_A_SCENES): listens toplayer-hit,enemy-defeated,boss-defeatedandregion-turned. Everything else is called from game code:sound.play('chair-whoosh'),sound.loop('boss-jenny')(lane B: footsteps, swings, motors; [M4-S1] Jenny rams you on the bridge and the creek turns #54: the boss loop). M mutes. In dev builds F7 steps through the effects and F6 through the loops (name in the console).Verification
npm run typecheck,npm test(28 passing, 6 new: every docs/07 effect has a recipe, nothing over 0.9 peak gain, loops stay inside their bars, anomaly detune),npm run build,check_docs.py.runningand the garden loop schedules bars;region-turnedswitches it to the creek; no console errors.Issue
Closes #71 (stacked PR – linked by hand under Development).
Stack
Merge bottom up.