BGM: procedural chiptune background music via Tone.js (title + in-game loops, fits all-AI-generated scope) #15
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/cellblock#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The v1 polish sprint added Web Audio synth SFX (lock/clear1-3/tetris/combo/garbage/start/win/lose/select/move/rotate) and a short procedural chiptune loop. Operator feedback after live-play: the audio-distinction between regular clears and the 4-line tetris was effective. Next natural depth: actual background music — title-screen loop + in-game loop — to round out the arcade feel.
Fits the all-AI-generated content scope: no licensed music, no external content dependencies, procedurally composed in-code.
Approach
Tone.js procedural composition (Bosun-lean ratified by operator).
Integration
audio.tsstartMusic(track)/stopMusic()to accept a track name and swap between current synth loop and BGMsetVolume(),toggleMuted()— BGM uses same Web Audio gain stagesScope fence (NOT in this tracker)
Acceptance criteria
Effort
~2-3 hours of crew work. Single-chamber pickup (Lookout natural fit per his audio.ts authorship). Could be its own mini-sprint or a free pick when someone has cycles.
Process-exception trace (on-record, per Herald): commit
@1327031(Lookout's D+E end-state musical phrases —play("win")→fanfare,play("lose")→top-out phrase) was direct-pushed to main, bypassing the review cadence — a substrate-forced one-off (codex gating made PR-and-wait impractical), not a new pattern.Surveyor post-hoc review → CLEAN; review-coverage restored. Audited the commit (audio.ts only, +34/-3): additive + well-scoped (new
PhraseSteptables +phrase()helper; only thewin/losecases swap), integration-disjoint from the BGM music-bus engine (routes through the SFX/master bus as before, fires at gameover when BGM is already stopped), all other SFX cases untouched. Gates corroborated on main9971de1— tsc 0,npm test0, vite build 0. No problem found.