littleBits Arduino tone sequencer

The littleBits Arduino module has the potential to be a MIDI-driven tone generator for a mono or paraphonic synthesizer. After getting the module, I was anxious to try it out even though I haven’t built a MIDI interface for it (yet).

Here is a picture of the littleBits hardware. (Click the image to get full resolution.) The Arduino module is in the middle between the controls at the left (button and dimmers) and the synth speaker at the right. The controls on the left hand side don’t do anything at the moment. I put a dimmer between the output pin (D5) and the synth speaker in order to control audio volume. It’s just more convenient to control the volume with a dimmer than the tiny trim pot on the synth speaker module. The knobs on the dimmers are my own touch; they aren’t standard-issue with the littleBits dimmers.

arduino_dimmer_speaker

To keep things simple, I wrote a sketch that implements a basic note sequencer. Each note has a pitch (frequency) and a duration (milliseconds). The notes are stored in an array. The Arduino loop() function steps through the array of notes and plays one note at a time. After the loop plays the last note in the array, it goes back to the beginning of the array. The loop has a delay() in it and the loop keeps track of the remaining duration of the currently playing note. The sketch calls the Arduino tone() function to play notes by sending a square wave at the desired frequency to output pin D5.

If you would like to learn more about this project, then read about the design of this simple Arduino-based sequencer and tone generator. Here are links to the source code:

ToneTest.ino: Main sketch
ToneFreq.h: Note frequencies
ToneNote.h: Note durations

The D5 and D9 output pins on the littleBits Arduino module have a switch that enables or disables low pass filtering. The “analog” switch position turns on the filtering. The “pwm” position turns filtering off. Should you build this project yourself, try both switch positions. The “pwm” position doesn’t filter the square wave and you will hear it loud and nasty. The “analog” position produces a quieter, mellower timbre thanks to the low pass filter. Be sure to try the littleBits synth filter, envelope and delay modules, too.

One more tidbit. Pictures of the littleBits envelope, filter and delay modules usually show the top-view. The picture below flips the modules over and shows the bottom-view.

envelope_filter_delay

From left to right, the modules are the envelope, filter and delay, respectively. There is some serious electronics on these boards! (Click the image for full resolution.) I hope to use these modules to mangle audio, not just synthesis.

All the best.

Update: 28 June 2016. If you enjoyed this project and have the littleBits Synth Kit, then check out an expanded version of the tone sequencer which drives the filter and envelope modules.