Skip to content

Add 8-pad radar drum machine (walabeat2_gui.py)#1

Open
peterkoczan wants to merge 11 commits into
Walabot-Projects:masterfrom
peterkoczan:feature/8-pad-drum-machine
Open

Add 8-pad radar drum machine (walabeat2_gui.py)#1
peterkoczan wants to merge 11 commits into
Walabot-Projects:masterfrom
peterkoczan:feature/8-pad-drum-machine

Conversation

@peterkoczan

Copy link
Copy Markdown

What this adds

A new script WalaBeat/walabeat2_gui.py that expands WalaBeat from 2 pads to 8 pads by dividing the sensor's field of view into a 4 azimuth × 2 depth grid:

         LEFT  ←————————————————→  RIGHT
FAR    [Crash] [  Tom ] [ Ride ] [Open HH]
NEAR   [Hi-Hat] [ Kick ] [Snare] [  Clap ]
              ↑ sensor faces you ↑

Features

  • Top-down radar fan visualisation in tkinter — sectors light up proportional to signal energy and flash on hit
  • Dead zones between adjacent pads to reduce cross-talk
  • Snare roll — sustained fast wave in the near outer-right zone fires rapid snare hits
  • generate_sounds.py — synthesises all 8 WAV files using only the Python standard library (no sox, ffmpeg, or other tools needed)
  • Audio via subprocess + aplay (avoids pygame .so loading issues on some Linux/ARM setups)

Requirements

Same as the existing WalaBeat: Walabot SDK + WalabotAPI Python package + tkinter.

Run

python3 WalaBeat/generate_sounds.py   # once, to create WAV files
python3 WalaBeat/walabeat2_gui.py

peterkoczan and others added 11 commits April 20, 2026 13:11
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant