oneshotlm
Compare all models on this prompt →

Drum machine · qwen3.6-27b

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 · 8 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
The user wants a single-page drum machine web app with:
- 16-step sequencer grid
- 4 instruments: kick, snare, hi-hat, clap
- All sounds synthesized with Web Audio API (no samples)
- Clickable grid to toggle steps
- Play/stop button
- Adjustable BPM
- All in one index.html file with inline CSS and JS
- No external resources

Let me build this with a clean, modern design. I'll synthesize each drum sound using Web Audio API oscillators and noise generators.
write /workspace/index.html (19053 bytes)
toolResult

Successfully wrote 19053 bytes to /workspace/index.html

assistant
thinking
The initial version has a messy scheduler implementation. Let me clean it up - the `advanceTime` function is defined twice which is confusing, and the swing logic is a bit convoluted. Let me rewrite this with a clean, proper scheduler.

Let me clean up the scheduler logic — there's duplicate code and the swing implementation needs to be more robust:

write /workspace/index.html (15445 bytes)
toolResult

Successfully wrote 15445 bytes to /workspace/index.html

assistant
thinking
Let me verify the file is valid and present.
bash {"command":"wc -l /workspace/index.html && head -3 /workspace/index.html && echo \"---\" && tail -3 /workspace/index.html"}
toolResult

512 /workspace/index.html <!DOCTYPE html> <html lang="en"> <head> --- </script> </body> </html>

assistant
thinking
The file looks good. Let me verify there are no syntax issues by checking the HTML structure more carefully.

The drum machine is ready at `/workspace/index.html`. Here's what it includes: **Grid:** 16-step sequencer for 4 instruments — Kick, Snare, Hi-Hat, and Clap. Click any cell to toggle it on/off. A white border highlights the currently playing step. **Synthesized Sounds (Web Audio API, zero samples):** - **Kick** — dual sine oscillators with pitch envelope (160→30 Hz + sub at 80→25 Hz) - **Snare** — triangle oscillator tone + high-pass filtered white noise burst - **Hi-Hat** — short band-passed (10 kHz) noise impulse - **Clap** — three closely-spaced noise bursts through a ~2.6 kHz bandpass filter with a sustained tail **Controls:** - **Play / Stop** button (also toggled with Space bar) - **BPM slider** (60–200, default 120) - **Swing slider** (0–100%) — shifts odd-numbered sixteenths forward for a groovier feel - **Clear All** button to reset the pattern **Preset pattern** loads on start: four-on-the-floor kick, backbeat snare/clap, and alternating hi-hats.

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

modelqwen3.6-27b
vendorQwen
harnesspi-agent
generated2026-07-31

EVALUATION

4/5 working

16-step drum machine grid with kick/snare/hihat/clap, play/stop toggles, BPM slider, step playback highlight visible.

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.1%
on enter + space1.6%
on arrow keys1.5%
on w/a/s/d1.6%
frame spread19.5 / 255
console errors0
js errors none

METRICS

runtime287.6s
tokens in20k
tokens out13k
cached18k
cost / run$0.0463