The old joke goes something like this: “What’s the difference between a drummer and a drum machine? You only have to punch the information into the drum machine once.”
DIY music projects almost always rely on a Raspberry Pi, or perhaps an Arduino, so it’s unusual to encounter one that is based on the Teensy. Using a Teensy 3, YouTuber Matt Bradshaw (the chap behind the Nerd On The Wire channel) has produced a three-button electronic drum machine, which plays samples from Freesound. The end result is a compact (although this can obviously be scaled up) drum machine that plays a convincing selection of beats on command.
Also included in the build is a Teensy audio adaptor board, four 14-pin stackable male/female headers, jumper wires, a breadboard, tactile buttons (the project uses three), soldering iron and solder, and a USB power cable, along with your PC. You’ll also need headphones or a speaker to hear the output!
As you can see in the video, it’s a compact build, but it will require a bit of soldering, so don’t attempt this unless you’re confident, and your soldering iron is up to scratch. Once it’s up and running, the drum machine will need some configuration to make some noise, so the kick drum, snare and hi-hat sounds play when the buttons are tapped. Although some coding is required in the form of Arduino-format sketches, the WAV files also need to be converted into Sketch format, using the wav2sketch software, which you’ll find at GitHub.
The end result should let you knock out a few rhythms by hand, such as in the video above, although your first improvement could be to find a way to record your drums into a loop, and play them back via a simple trigger (although an LCD display may be needed for this).
Want the full tutorial and code? You’ll find it in the latest issue of Hackspace from the Raspberry Pi Foundation. You can also download Hackspace issue #9 in PDF free from the Raspberry Pi website.