Modular Music Box – Arduino polyphonic audio 2
While the Auduino project provides plenty of code tweaks and hardware hacks to make an easy to use but versatile monophonic synth the Modular Music Box requires polyphony…
So I’ve been on a mission to try and find a suitable solution…
A while back I came across and subsequently ordered a Smapler v2 from Arduino-meister David Cuartielles at blushingboy.org – twice in fact – and though I received an email response while he was in Mexico in August my orders have never been processed. The website and shop are still online but his attention must be elsewhere – so I’ve given up trying to get hold of a kit. Shame.
I’ve since contacted the makers of other relevant projects I’ve come across asking if they might be willing to share some resources, insights – and perhaps even some code – including:
- John Gifford’s Arduino based three note polyphonic music box at techroadie – http://www.techroadie.com/myo-make-your-own-roundup-for-september-2009/;
- Seb Tomczack a.k.a. Little Scale – who generally seems to be way out ahead of the pack and single-handedly responsible for most of the ‘must check out’ youtube demos I came across while searching online for making sound and music using an Arduino;
- and Pablo Gian Villamil – Generating polyphonic sound with Arduino – “I have developed a method, using simple voltage-controlled oscillators and the AD5206 digital pot, that allows generation of very nice-sounding musical tones from an Arduino, using a very small number of digital outputs, and requiring very little CPU overhead.”
and Pablo responded and kindly sent me on a link to his notes and code gathered as part of a class on Arduino audio he taught at NYC Resistor.
Independently, I also came across Nicolas Collins’ excellent book Handmade Electronic Music: The Art of Hardware Hacking and Chapter 18 THE WORLD’S SIMPLEST OSCILLATOR: SIX OSCILLATORS ON A TWENTY-CENT CHIP, GUARANTEED TO WORK introduces the 74C14 Hex Schmitt Trigger IC – which turns out to be the sound source for Pablo’s circuitry too.
I’ve had success with Pablo’s examples – though it took me a little while to work out that Serial Peripheral Interface (SPI) on an Arduino Mega uses different pins (SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS) – as opposed to 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK) on a Duemilanove/Uno – doh!) – and now have the circuit working with Pablo’s test code to create a 3 voice “microcontroller-based implementation of Steven Reich’s Piano Phase piece, as interpreted by ASDF”. There’s plenty more to explore here too… he developed a series of practical implementations using this technique with lots of interesting functionality.
For more info on SPI there’s Arduino Tutorials on Interfacing a Serial EEPROM Using SPI & Controlling a Digital Potentiometer Using SPI (the basis of Pablo’s project – using an AD5206 Digital Potentiometer to control the 74C14 Hex Schmitt Trigger) and Arduino Reference on the SPI Library.
In the Indices to Pablo’s class notes there’s a series of relevant and intriguing links from uchobby.com. A quick scan of these led me to Paul Badger’s Synth Code and so to Modern Device and so to the Fluxamasynth rev.1 – “a robust synthesizer that can be completely controlled by the on-board Arduino-compatible microcontroller”.
This really does look like it’s exactly what we need – “based on Atmel’s ATSAM2195 single-chip MIDI sound system… has a built-in wavetable with 128 general MIDI sounds and an additional set of 128 variations and dozens of percussion sounds. It can play music in 64-voice polyphony without effects or 38 voices with effects.”
I’ve ordered one and it’s on it way…