Beat Box at littleBits!

Apologies in advance as I spend more time remembering to be a musician, not a technology blogger. I bought a few MIDI files during the last Yamaha Musicsoft sale and I’m massaging them into PJ-approved backing tracks. Plus, I’m learning about the joys of the key of D-flat!

I posted the Beat Box drum machine project to the littleBits invention site. The littleBits project format is more “step-by-step” than the document that I post on this site. The step-by-step directions should help anyone interested in building the Beat Box without diving into the details of the design. Of course, you can still check out the Beat Box design at this site, too. (MP3 Demo)

Just so you don’t think I’ve been totally idle, I tried adapting the code to sing “Do-Re-Mi” solfege. This involved recording and editing my voice. I used my old trick of singing through the Yamaha PSR-S950 vocoder in order to pitch correct my rocky intonation. I had to lower the sample rate to 11,025Hz in order fit all eight syllables into the very small Arduino program memory (PROGMEM). Unfortunately, I cannot get clear audio at 11,025Hz. There is this raucous buzz which cannot be eliminated through filtering. I suspect that the problem is in the PWM generation itself. The waveforms play back fine at 22,050Hz, sounding like chipmunk solfege.

After hitting that brick wall, I’ve decided to take a different approach which has better long term possibilities. I’ve ordered a handful of MCP4921 12-bit SPI DAC ICs and intend to try them with the littleBits Arduino module. The littleBits Arduino is a Leonardo where the SPI interface is the (unpopulated) ICSP pads. The new approach requires soldering, but it should be worth the effort. Stay tuned.

Still tempted by the Reface CP and YC. But, $400USD street? C’mon, Yamaha!

Arduino lo-fi beat box

Here’s another Arduino-based music project for ya — the Beat Box — a lo-fi, TR-808 drum machine. If you ever wanted to try your hand at DIY electronics, this one is a good starting point. Here is a short list of features:

  • 16 grungy, TR808-like rhythm instruments
  • Up to eight instruments per pattern
  • Up to five selectable patterns
  • Adjustable tempo (60 BPM to 188 BPM)
  • Full source code available including waveforms (samples)
  • Write and compile your own patterns, drum kits and waveforms
  • Built-in PWM signal generation into an external low pass filter
  • 22,050Hz, 8-bit signed, mono waveforms for true lo-fi grunge

The Beat Box uses the Arduino’s internal high resolution timer (TIMER1) to produce audio. The timer converts samples to a pulse-width modulated (PWM) bit stream which is sent into a simple low pass filter. The filter converts the PWM bit stream into an audio signal to be sent to a powered speaker, LINE IN, or what have you. This is absolutely the cheapest way to generate digital audio with an Arduino and it only requires four simple components, a solderless breadboard and a few jumper wires.

If you want to make assembly even easier, start with the littleBits Arduino Coding Kit, a Proto module and a Synth Speaker Module. I built the Beat Box using the littleBits Arduino Coding Hit and assembly was, literally, a snap.

The Beat Box source code includes drum waveforms and several classic drum patterns. With a 22,050Hz sampling rate and 8-bit samples, you get genuine lo-fi, bit-crunched TR-808 grunge. Purely optional, I added a littleBits synth Filter module and Delay module to the audio signal chain. Listen to the MP3 demo. In the demo, I sweep the filter frequency from low to open. At about 10 seconds in, you hear what is essentially the unfiltered sound of the Beat Box. Then, I increase the delay feedback level which adds echoes in time with the original pattern.

This pattern forever reminds me of riding the RTA #48 bus to work in Cleveland circa 1982.

Per standard operating procedure, I have provided the full design and source code.

Get your beat on! Build it now!