Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🥁 Weird Drum Machine v2

A self-contained, procedurally-synthesised drum machine for the ESP32. Every sound is generated on-chip in real time — no samples, no SD card. Twist two knobs to change tempo and pattern; watch a live 16-step sequencer on an OLED.

Heltec / generic ESP32 + MAX98357A I²S amp + SSD1306 OLED + 2 pots

⚡ Flash it from your browser

No Arduino IDE required. Open the web flasher in desktop Chrome or Edge, plug your ESP32 in over USB, and click install:

(Powered by ESP Web Tools via the Web Serial API.)

Features

  • 12 patterns across 4 sound kitsSTD, DARK, GLCH (glitch), ALTN (alien)
  • 3 voices per pattern: kick, snare, hi-hat — all synthesised with exponential-decay envelopes and noise
  • 20–200 BPM, live tempo control with adaptive smoothing
  • 16-step sequencer rendered on a 128×64 OLED with a moving playhead
  • Dedicated audio task pinned to core 0 for glitch-free I²S playback

Controls

Input Function
Pot A (GPIO 36) Tempo (20–200 BPM)
Pot B (GPIO 39) Pattern select (1–12)
OLED Step grid + BPM / kit readout

Wiring

Component Signal ESP32 GPIO
SSD1306 OLED (I²C) SDA 21
SCL 22
MAX98357A (I²S) BCLK 26
LRC / WS 25
DIN 27
Tempo pot wiper 36 (ADC1_CH0)
Pattern pot wiper 39 (ADC1_CH3)

Wire each pot's outer legs to 3V3 and GND, wiper to the listed GPIO. The MAX98357A drives a small 4–8 Ω speaker.

Build from source

Requires the Arduino IDE (or arduino-cli) with:

  • esp32 board package by Espressif (core 3.x)
  • U8g2 library by oliver (Library Manager)
arduino-cli compile --fqbn esp32:esp32:esp32 esp32_drumachine_new_nd_good.ino
arduino-cli upload  --fqbn esp32:esp32:esp32 -p COM5 esp32_drumachine_new_nd_good.ino

Note: setup() runs a one-time pot diagnostic that prints 300 ADC readings to the serial monitor at 115200 baud before the sequencer starts. Open the serial monitor and turn the pattern pot to verify it's wired correctly.

Repo layout

esp32_drumachine_new_nd_good.ino   # the sketch
docs/                              # GitHub Pages web flasher
├── index.html                     # ESP Web Tools install page
├── manifest.json                  # firmware manifest
└── firmware/drumachine-esp32.bin  # merged 4 MB flash image

License

MIT — see LICENSE.

About

Procedural ESP32 drum machine — 12 patterns, 4 synth kits, OLED sequencer. Flash it from your browser.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages