A RP2040-based eurorack module for sample playback and drum machine functionality. Features multiple voice sample playback, real-time speed/pitch control, and trigger-based sequencing using the Mozzi audio synthesis library.
- Multi-voice drum machine with 4 sample slots (kick, snare, hihat, tom)
- Trigger-based sequencing compatible with eurorack trigger signals
- Real-time sample playback using Mozzi audio synthesis library
- I2S audio output via PCM5102A DAC for high-quality audio
- 4-button trigger system with hardware debouncing (GPIO6-9)
- Real-time sample triggering for live performance
- Individual sample assignment per button (Kick, Snare, Hihat, Tom)
- Eurorack-compatible trigger inputs with protection circuitry
- Flash memory storage for embedded drum samples
- RP2040 microcontroller optimized for real-time audio
- 0.91" OLED display (128x32) for visual feedback and control
- Eurorack-compatible trigger inputs and CV control
- I2S DAC output (GPIO26=BCK, GPIO27=LCK, GPIO28=DIN)
- I2C interface (GPIO4=SDA, GPIO5=SCL) for OLED display
- Serial interface for development and configuration
- Raspberry Pi RP2040 microcontroller (Pico or compatible)
- PCM5102A I2S DAC for high-quality audio output
- 0.91" SSD1306 OLED Display (128x32, I2C interface)
- 4x Momentary Push Buttons for sample triggering
- Protection circuitry for eurorack trigger compatibility (optional)
- I2S Connections:
- GPIO26 → BCK (Bit Clock)
- GPIO27 → LCK (Word Select) - automatically assigned
- GPIO28 → DIN (Data Input)
- I2C Connections:
- GPIO4 → SDA (I2C Data)
- GPIO5 → SCL (I2C Clock)
- Button Connections:
- GPIO6 → Button 1 (Kick) → GND
- GPIO7 → Button 2 (Snare) → GND
- GPIO8 → Button 3 (Hihat) → GND
- GPIO9 → Button 4 (Tom) → GND
- Power: 3.3V from eurorack power supply
| Key | Function |
|---|---|
SPACE |
Trigger sample via serial |
| Button | GPIO | Function | Sample |
|---|---|---|---|
| Button 1 | GPIO6 | Trigger Sample 1 | Kick Drum |
| Button 2 | GPIO7 | Trigger Sample 2 | Snare Drum |
| Button 3 | GPIO8 | Trigger Sample 3 | Hi-hat |
| Button 4 | GPIO9 | Trigger Sample 4 | Tom |
Hardware buttons work in both sine wave and sample modes
- PlatformIO installed
- RP2040 development board
- I2S DAC/amplifier module
-
Clone this repository:
git clone https://github.com/funkfinger/pico-dac-sampler.git cd pico-dac-sampler -
Build and upload:
pio run --target upload
-
Open serial monitor:
pio device monitor --baud 115200
- Place your WAV file in the
source/directory - Run the conversion script:
python3 convert_wav.py
- Include the generated header file in
main.cpp
- Memory Usage: 9.2% RAM, 13.7% Flash
- Audio Quality: Linear interpolation with fractional positioning
- Buffer Size: 512 samples for smooth playback
- Sample Rate: 16kHz (automatically converted from source)
- Bit Depth: 16-bit signed integers
- Channels: Mono (stereo automatically mixed to mono)
- 0.5x: Classic slow-motion with lower pitch
- 2.0x: Fast playback with higher pitch (chipmunk effect)
- Speed 0.5x, Pitch 1.0x: Slow motion with normal pitch
- Speed 1.0x, Pitch 1.5x: Normal speed with higher pitch
- Speed 2.0x, Pitch 0.8x: Fast playback with lower pitch
├── src/
│ ├── main.cpp # 4-button drum machine with sample playback
│ ├── step_sample.h # Embedded audio sample data
│ └── main_mozzi.cpp # Backup reference file
├── source/ # Original drum samples (to be added)
├── AI/
│ └── user_stories.md # Project roadmap and user stories
├── convert_wav.py # WAV to Mozzi format converter (to be updated)
└── platformio.ini # Project configuration with Mozzi
The project uses the Mozzi audio synthesis library for efficient real-time audio generation and the arduino-pico core for RP2040 support.
updateAudio(): Mozzi audio generation callback (16kHz) for sample playbackupdateControl(): Mozzi control callback (64Hz) for button processingaudioOutput(): Custom I2S output function for external DACupdateButtons(): Hardware debouncing and trigger detectionprocessButtonTriggers(): Sample triggering logic
- Multi-voice sample playback engine
- Trigger input handling for eurorack compatibility
- Real-time speed/pitch control per voice
- CV input processing for parameter modulation
This project is open source. Feel free to use, modify, and distribute.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
Built with ❤️ for the eurorack and RP2040 communities