oneshotlm
Compare all models on this prompt →

Drum machine · glm-5.2

Output generated Cost / run $0.0202 Runtime 61.5s

Prompt for this run

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 ↗

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

METRICS

runtime61.5s
tokens in7.6k
tokens out4.9k
cached2.3k
cost / run$0.0202
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.