Close

DrumKid: A History

A project log for DrumKid: aleatoric drum machine

A lo-fi digital drum machine which uses randomness to create unpredictable beats. Runs on Arduino, with audio provided by the Mozzi library.

Matt BradshawMatt Bradshaw 04/24/2019 at 05:310 Comments

Work continues apace on DrumKid. A brief update: I took the prototype to the pub to show some friends, who unanimously concluded that it was "cool" but "too quiet" through headphones. I had been hoping to avoid this problem - the better I clean up the output signal (using an RC circuit), the quieter it becomes, and it's now officially too quiet to contend with the background noise in a pub garden. I've been reluctantly playing with an LM386 amplifier chip, with a mixture of success (it's louder) and frustration (the noise from the power supply is also louder).

Anyway, I thought I'd write a bit about the genesis of DrumKid, since it already existed in another form before this Arduino-based iteration of the project. A few years ago, I decided to start a band. I found a bassist and a synth player to complement me on guitar and vocals, but I didn't want to use a drummer. My opinion was that having real drums in a band always pushed my music towards a pastiche of rock, so I wanted another way of generating rhythms, something with the expressiveness of a good drummer but without the robotic tendencies of a simple drum machine.

At the time I had been playing with the Web Audio API (the surprisingly full-featured Javascript synthesizer engine found in modern browsers), and stumbled across this article about scheduling precise drum hits in Javascript. I stole the code, spent a long time playing around with it, and ended up with a web-based drum machine I called "DrumKid".

Screenshot of the original browser-based DrumKid

The basic premise was/is to start with a simple drumbeat (e.g. kick, snare, kick, snare), then modify it with a number of continuous controls (sliders). The main controls are:

  1. "Hyperactivity" - how likely the algorithm is to add an extra drum hit on a given step
  2. "Zoom" - changes the subdivision of step which can be heard (on its lowest setting, only the first beat of the bar is heard, but the highest setting will allow 64th-notes, sounding much more "hectic")
  3. "Ceiling" - silences any notes below a certain threshold, creating a less "busy" sound
  4. "Blend" - interpolates between two different basic drumbeats
  5. "Sloppiness" - shifts the timing of each step by a random amount (basically a random quantize function)

These parameters, and especially the first two, could be manipulated in real time to produce dynamic, non-robotic beats. I also added a number of audio effects such as resonant filter, delay, reverb, and pitch shift.

The interface was optimised for a touch screen - I would borrow the iPad from my office, tape it to a music stand, and our bassist would control it during songs. He modified his playing style to allow him to control DrumKid while also performing bass duties, for instance by playing a long, loud bass note which would sustain for a couple of bars while he increased the "hyperactivity" and "zoom" controls before a chorus. Here's a video of our band, Robot Swans, in action with DrumKid a few years back:

We made a whole album with DrumKid, The Tyranny of Robot Swans, and a few of our friends used it in their own music. When our bassist left the band, we changed our style slightly and DrumKid fell out of use for a while, but I had always held onto the idea of making a proper, standalone physical version of it. When I decided to leave my programming job and become a freelancer, I soon focused on the idea of making my own off-kilter musical instruments, and DrumKid seemed like the ideal first project. It can be made small, and doesn't require much processing power, allowing it to run on an ATMega328. I've had to compromise on a few things (audio quality is reduced, reverb is unlikely, not all parameters can have their own knobs, etc), but the limitations of the Arduino version are actually making it more rewarding to develop for - squeezing extra features out of a £2 chip becomes almost like a game, and I've been able to add things like bit-crush which weren't in the original Javascript design.

If you'd like to play with the original DrumKid online, here's a link.

Discussions