16-step drum machine with an AI beat helper
A standalone drum machine: a lit 4x4 NeoTrellis pad grid programs 16-step patterns, a Teensy 4.1 plays drum samples from its SD card through the PJRC audio adaptor, and three knobs set tempo, swing and volume. An AI helper turns "boom-bap at 90 BPM" into patterns you load.

Safety first
- Start with the volume low before putting on headphones; sudden loud transients can hurt your hearing.
- Only use drum samples you made or have a license to use.
Rules and laws
- Sample packs come with licenses. Check that yours allow use in your own music, especially if you publish it.
Parts
| Part | Qty | Approx. each | Subtotal |
|---|---|---|---|
| PJRC Teensy 4.1Has a built-in microSD slot for samples. Solder pins before mounting the audio board. Typical $30-36, no verified link.Amazon (search) | 1 | $31.50 | $31.50 |
| PJRC Teensy Audio Adaptor Rev DRev D matches Teensy 4.x pinout. Typical $13-17, no verified link.Amazon (search) | 1 | $13.75 | $13.75 |
| Adafruit NeoTrellis RGB driver PCB for 4x4 keypadPrice seen $12.50 on Adafruit (Nov 12, 2026).Adafruit | 1 | $12.50 | $12.50 |
| Adafruit silicone elastomer 4x4 button keypadPrice seen $4.95 on Adafruit (Nov 12, 2026). Fits the NeoTrellis PCB.Adafruit | 1 | $4.95 | $4.95 |
| 10k linear potentiometer with knob (pack)Typical $6-11, no verified link.Amazon (search) | 1 | $8 | $8 |
| SanDisk Ultra 32GB microSD cardTypical $7-12, no verified link.Amazon (search) | 1 | $10 | $10 |
| Male header pins (break-away, pack)Typical $4-8, no verified link.Amazon (search) | 1 | $6 | $6 |
| Creative Pebble USB speakersSkip if you already own one. Any powered speaker or headphones on the 3.5 mm jack work. Typical $20-30, no verified link.Amazon (search) | 1 | $25 | $25 |
| Estimated total (parts only) | $111.70 | ||
Typical US prices, checked 2026-11-12. Prices change and multi-packs are often cheaper per piece.
As an Amazon Associate I earn from qualifying purchases. Prices change; check the store.
Filament
PLA (1.75 mm): about 93 g (31.2 m), roughly 9.5 h of printing.
PLA, 0.2 mm layers, 15% infill, 2 walls (the settings the v1 files were sliced with); print the top panel face-down for a smooth surface.
AI agents you'll use
- Code helper (ChatGPT, Claude, Gemini or Grok): Writes the Teensy sketch: NeoTrellis input, 16-step sequencer with swing, and Teensy Audio Library sample playback from the SD card.
- Beat helper: Turns a style description into 16-step patterns for kick, snare, closed hat and open hat as arrays you paste into a file on the SD card.
Tools
- Soldering iron
- Wire stripper
- Small screwdriver
- USB micro-B data cable
- Headphones or a powered speaker
What you'll learn
- Sample playback with the Teensy Audio Library
- Step sequencers and swing timing
- I2C keypads with RGB feedback
- Turning text ideas into drum patterns
Tap in a beat on glowing pads and hear it loop instantly, no laptop needed. The AI helper is your producer friend: describe a groove and it hands you a pattern to start from.
What you'll build
A desk box about 15 x 12 cm. The 4x4 NeoTrellis is the step grid: each pad is one of 16 steps for the selected drum, lit when active, with a moving light showing the playhead. The Teensy 4.1 plays WAV samples from microSD through the audio adaptor's headphone/line output. Three knobs set tempo, swing and volume; holding a pad combination switches drum tracks and saves patterns to SD.
The cost range is $75-125. The low end assumes you already own these items marked "skip if you already own one": Creative Pebble USB speakers. The high end includes them.
Print the parts
Print a top panel with a 4x4 cut-out matching the elastomer keypad and three knob holes, plus a base. Adafruit's NeoTrellis guide has dimensions. Credit any designer you remix.
Wiring
| From | To | Notes |
|---|---|---|
| Audio Adaptor Rev D | Stacked on Teensy 4.1 with headers | Uses I2S and I2C pins; follow PJRC's pin table. |
| NeoTrellis VIN / GND | Teensy 3.3V / GND | |
| NeoTrellis SDA / SCL | Teensy pins 18 / 19 | Shared with the audio codec control bus (different address). |
| Potentiometers (3) | Teensy 3.3V, GND and pins A14, A15, A16 (pins 38, 39, 40) | Check these are free with the audio board fitted. |
| Headphones or speaker | Audio adaptor 3.5 mm jack |
Step-by-step
- Solder headers and stack the audio adaptor on the Teensy 4.1.
- Run PJRC's WAV-player example from the SD card to confirm audio works.
- Wire the NeoTrellis and run Adafruit's NeoTrellis example.
- Write the sequencer with the AI helper: grid input, playhead, four drum tracks.
- Add the knobs for tempo, swing and volume.
- Ask the beat helper for a few patterns and load them from SD.
- Print the enclosure and mount everything.
Code
Arduino IDE with Teensyduino, the Teensy Audio Library and the Adafruit seesaw library for the NeoTrellis.
Prompt for the code helper:
Write a Teensyduino sketch for a Teensy 4.1 + Audio Adaptor Rev D drum machine.
Inputs: Adafruit NeoTrellis 4x4 on I2C (pins 18/19), pots on A14 (tempo 60-180 BPM), A15 (swing 0-60%), A16 (volume).
Four tracks (kick, snare, closed hat, open hat) of 16 steps; WAV samples KICK.WAV etc. on the built-in SD card played with AudioPlaySdWav objects into a mixer. Light active steps per track, show the playhead, and load/save patterns from PATTERNS.TXT.
Use the Audio System Design Tool object names from the official PJRC library.
Troubleshooting
- Clicks or dropouts: Too many simultaneous SD reads. Use short samples or load them into memory with the library's memory player.
- No sound: Check the audio adaptor is Rev D and the sgtl5000 is enabled with a volume above zero.
- Pads do not respond: NeoTrellis address or wiring; run the Adafruit example first.
Print files
- Base: drum-base.stl (326 KB) · drum-base.3mf (20.9 KB)
- Top: drum-top.stl (61.6 KB) · drum-top.3mf (14.4 KB)
License CC BY 4.0, aimebro. v1, not test-printed yet
Files, code and docs
- PJRC Teensy Audio Library (Vendor docs)
- Adafruit NeoTrellis guide (Vendor docs)
- Adafruit seesaw library (NeoTrellis) (BSD)
Last checked 2026-11-12. Double-check parts against your own board and seller listings before you buy.