oneshotlm
Compare all models on this prompt →

Drum machine · glm-5.2

Build a 16-step drum machine with a clickable grid for kick, snare, hi-hat, and clap, all sounds synthesized with the Web Audio API, plus play/stop and an adjustable BPM.

⛨ sandboxed Open in new tab ↗
transcript · 4 messages
user

Build a 16-step drum machine with a clickable grid for kick, snare, hi-hat, and clap, all sounds synthesized with the Web Audio API, plus play/stop and an adjustable BPM.

assistant
thinking
Let me build a self-contained drum machine in index.html.
write /workspace/index.html (15849 bytes)
toolResult

Successfully wrote 15849 bytes to /workspace/index.html

assistant

Built the drum machine in `/workspace/index.html`. It's fully self-contained — no external resources. **Features:** - **16-step grid** with 4 tracks: Kick, Snare, Hi-Hat, Clap — each color-coded - **Web Audio synthesis** (no samples): - Kick: sine pitch-sweep + click transient - Snare: filtered noise burst + tonal body - Hi-hat: band-passed noise, short decay - Clap: multi-burst band-passed noise for that classic clap feel - **Play/Stop** button with look-ahead scheduler for tight timing - **Adjustable BPM** (40–240) via number input + slider, synced live - **Beat highlighting** every 4 steps, current-step indicator while playing - **Clear** button and **spacebar** shortcut to toggle playback - Click a cell to toggle it (and audition the sound immediately) - Pre-seeded with a default groove so it sounds good on first play Open `index.html` in a browser and hit Play.

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelglm-5.2
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-08

EVALUATION

4/5 working

16-step drum machine grid with kick/snare/hat/clap rows, BPM slider, play/stop toggling via spacebar, and playhead moving across steps.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion0.0%
on click0.2%
on drag0.1%
on wheel0.0%
on enter + space0.8%
on arrow keys1.0%
on w/a/s/d1.1%
frame spread19.2 / 255
console errors0
js errors none

METRICS

runtime61.5s
tokens in5.3k
tokens out4.9k
cached2.3k
cost / run$0.0202