Refactor to dual-voice djembe drum mode with amplitude-based routing#67
Closed
od99-dev wants to merge 4 commits intotaigrr:masterfrom
Closed
Refactor to dual-voice djembe drum mode with amplitude-based routing#67od99-dev wants to merge 4 commits intotaigrr:masterfrom
od99-dev wants to merge 4 commits intotaigrr:masterfrom
Conversation
Adds repository guidance covering build/test commands, architecture overview, data flow, mode selection, escalation scoring, and stdio protocol. Defers to AGENTS.md for constants and gotchas. https://claude.ai/code/session_019kCvM2eg87w4goqQLqNG6C
Covers single-file code organization, mutex patterns, goroutine safety, adding new audio modes, testing strategy, amplitude scaling, and private dependency setup. https://claude.ai/code/session_019kCvM2eg87w4goqQLqNG6C
Claude/map codebase bfm54
- Remove all old modes (pain, sexy, halo, lizard, custom/custom-files)
- Add dualPack routing: amplitude >= --bass-threshold (default 0.25) → bass,
below → snare; each voice has its own cooldown timer so both can fire
independently and overlap freely
- Add --bass-dir / --snare-dir flags for custom MP3 directories
- Add --bass-threshold flag, also settable live via stdin {"cmd":"set","bassThreshold":0.3}
- Default cooldown reduced to 300ms (was 750ms) to suit drum feel
- Add placeholder audio/djembe/bass/ and audio/djembe/snare/ dirs (replace
with real djembe samples before building)
- Update stdin status/set responses to include bass_threshold field
- Update resetGlobals() in tests to initialise new globals
https://claude.ai/code/session_01DTW5RongQBNbFFq3KM9fyz
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.
Summary
Refactored spank from a multi-mode audio response system into a dedicated dual-voice djembe drum synthesizer. Hits are now routed to either bass or snare voices based on amplitude threshold, with independent per-voice cooldowns allowing both voices to play simultaneously.
Key Changes
Removed mode system: Eliminated
--sexy,--halo,--lizard, and--customflags along with their associated audio packs andplayModeenum (random vs. escalation). RemovedslapTrackerescalation scoring logic entirely.Introduced dual-voice routing: Added
dualPackstruct that holds bass and snaresoundPacks. NewselectVoice()method routes hits by comparing amplitude against--bass-threshold(default 0.25).Per-voice cooldowns: Replaced single
lastYelltimestamp withlastBassYellandlastSnareYell, allowing bass and snare to play independently. Default cooldown reduced from 750ms to 300ms per voice.New CLI flags:
--bass-threshold(default 0.25): amplitude threshold for routing to bass vs. snare--bass-dir/--snare-dir: override embedded audio with custom directoriesEmbedded audio reorganization: Replaced
painAudio,sexyAudio,haloAudio,lizardAudiowithdjembeBassAudioanddjembeSnareAudiopointing toaudio/djembe/bass/andaudio/djembe/snare/.Updated stdio protocol: Added
voicefield to JSON events (identifies "bass" or "snare") andbassThresholdto settings updates.Documentation: Added
CLAUDE.mdwith architecture overview, command reference, and development guidance.Implementation Details
run()function: now unconditionally loads both bass and snare packslistenForSlaps()now maintains separate cooldown timers per voice, enabling overlapping playbacksoundPack.loadFiles()now filters for.mp3extension explicitlyhttps://claude.ai/code/session_01DTW5RongQBNbFFq3KM9fyz