Add 8-pad radar drum machine (walabeat2_gui.py)#1
Open
peterkoczan wants to merge 11 commits into
Open
Conversation
Extends WalaBeat from 2 pads to 8 by dividing the sensor's field of view into a 4 azimuth × 2 depth grid: FAR [Crash] [Tom] [Ride] [Open HH] NEAR [HiHat] [Kick] [Snare] [Clap] New features vs the original: - Top-down radar fan visualisation in tkinter (no matplotlib) - Per-pad energy glow proportional to signal strength - Dead zones between adjacent pads to reduce cross-talk - Snare roll detection on sustained fast waves - generate_sounds.py: synthesises all 8 WAV files using only the Python standard library (no external tools needed) Audio via subprocess + aplay (avoids pygame .so loading issues on some Linux/ARM setups).
…clap fix - Live threshold slider adjusts sensitivity without restart - Auto-reconnect when sensor is unplugged mid-session - Hit counter in status bar + RESET button - Cross-platform audio: aplay/afplay/winsound, no extra packages - Fix: CLAP no longer misfires during snare roll (shared zone suppression) - Better synthesised sounds: kick/snare/clap layered, crash/ride with overtones - Updated README with cross-platform requirements
Radar signal attenuates ~R^4 with distance so far-zone pads returned much less energy than near-zone pads for the same hand movement. FAR_BOOST=3.0 scales far-zone energy before threshold and glow, making Crash/Tom/Ride/Open-HH as easy to trigger as the near pads.
The original WalaBeat used pygame.mixer which overlaps sounds on separate channels. We replicate that with a single persistent aplay process reading raw S16_LE from stdin and a mixing thread that sums all active wave streams each 512-sample chunk (~12ms). New sounds are added to the mix rather than competing for the ALSA device, so rapid hits and overlapping decays play naturally without cutting each other off.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 this adds
A new script
WalaBeat/walabeat2_gui.pythat expands WalaBeat from 2 pads to 8 pads by dividing the sensor's field of view into a 4 azimuth × 2 depth grid:Features
generate_sounds.py— synthesises all 8 WAV files using only the Python standard library (no sox, ffmpeg, or other tools needed)subprocess+aplay(avoids pygame.soloading issues on some Linux/ARM setups)Requirements
Same as the existing WalaBeat: Walabot SDK +
WalabotAPIPython package +tkinter.Run
python3 WalaBeat/generate_sounds.py # once, to create WAV files python3 WalaBeat/walabeat2_gui.py