Skip to main content
100%

Sonic Pi Drum Machine

✓ Published0🌍 Public
MMAKIO135
Last edited Nov 18, 2015
Created on Apr 3, 2017

This example turns a Sonic Pi drum machine script into a visual instrument panel. It shows a sequencer grid for three drum tracks—hi-hat, kick, and snare—with per-step amplitude values (0–9) mapped from the embedded pattern data. The Ruby code defines a `live_loop` and `run_pattern` API to schedule samples, using Sonic Pi’s `sample` and `sleep` functions with a `:pulse` synchronization loop. A selectable `use_kit` command switches between acoustic, electro, and toy sound kits via a `drum_kits` hash. The visualization highlights the code’s structure, not the audio output.

AI-generated description

Similar vizzes