Introduction: Simple Drum Machine With Arduino Uno and Mozzi

About: Argentine writer and inventor

Living in Argentina means that international mail will be stolen or get stuck in customs. Add Coronavirus quarantine and your next project is restricted to an old Arduino Uno board. Good news? As the great poet from Rolling Stones says “Time is on my side... yes it is”

I’ve downloaded Mozzi, the excellent – but also complicated – music library that does not require any additional hardware to work and I’ve started to read the documentation. I’ve came out with a simple drum machine/sequencer that can be operated entirely with 5 knobs and 1 button. The first knob will change beats per minute and other 4 knobs will determine what to play in every beat. I’ve added also 4 Leds to identify current beat.

Supplies

Arduino Uno

Mozzi Library

5 knobs

1 push button

1 audio jack

Optional 3d Printed Case

Step 1: Programming Details

Inside the code, as beats goes by, every knob is read and the value from 0 to 1024 is mapped to a 1-10 scale. 1 means silence. 2 means kick. 3 means hi hat. 4 means snare and latest positions are used for some synthesized sounds in different notes.

Step 2: Enclosure

The enclosure was made with 2mm rectangles and 4 screws.

Step 3: Sounds

Sounds were converted from wav to raw data and loaded as external.h files along with the .ino code. This procedure was a little bit tricky and involved external software like Audacity and also a Python script to convert the .raw to.h

The simple drum machine is fun to play, default sounds can be changed for other sounds like Gameboy effects and low-fi Atari sounds.

Of course quarantine also means no public for your odd electronic concerts, so I’ve made a little moving animatronic that will auto-detect the beats and moves the head to the music.

Step 4: Demo

Here is a demo of the Drum Machine being played.

The moving head is a stand alone project with Sound Module and Arduino Nano. It auto-detects BPM and moves head accordingly.