Modular Music Box – Synthesiser Control

We’re starting to make a serious push at the sound programming for the Modular Music Box.

The audio hardware is a Rev. 1 Fluxamasynth, a bare-bones Arduino board hosting an Atmel ATSAM2195 General MIDI chip with rudimentary onboard effects. The chip interfaces to the Arduino via the standard serial-port library, which makes communication between the board and a host computer a bit of a problem: loading up Arduino sketches works fine, but the serial link is then used for MIDI. (The example code even brings up the link at the MIDI speed of 31.25 Kbaud, which might just be an in-joke; I very much doubt that the synth chip is opto-isolated!)

While it’s probably possible to get USB serial and MIDI serial communications running independently, that seemed like too much fiddling around. Since the Music Box relies on I2C for communication between its components, it made sense to bring up an I2C link between the Fluxamasynth and an Arduino Mega which I happened to have lying around. This was pretty much just a case of loading the Fluxamasynth with a basic sketch which passes all I2C bytes verbatim to the synth chip (I2C is 8-bit clean, so no armouring or wrapping is needed). The Mega uses a modified version of the Fluxamasynth “library” – in reality just a collection of MIDI message formatters – to put completed MIDI messages onto the I2C bus rather than serial. The breadboarding looks rather like this:

Fluxamasynth and Arduino Mega

Yes, the power, ground and I2C lines to the Fluxamasynth are held in place by miniature G-clamps since I’m in no mood to try and solder up pin strips right now.

The remaining little chunk of work was to knock up a test environment for programming the Atmel and composing some sequences. That was a case of linking some libraries to for the Mega to talk to the MacBook running MaxMSP (reusing bits of code from PEAL and Bobby Sands) and then plugging in a Novation keyboard in order to play notes directly – or rather, slightly indirectly, tunnelling MIDI notes through formatting code in Python, sending them into the Mega, and having it put the MIDI messages on the I2C wire for the Fluxamasynth to pick up and send to the synth chip.

It’s not clear at this stage what the sequence playback engine will do – apart from anything else, the synth chip is multitimbral, suggesting some interesting compositional directions – but we can breadboard that in MaxMSP (or, more sensibly, MaxMSP plus Python). Since we haven’t yet assembled the disc playback hardware, we might port the Max code into Max for Live, and then compose and run sequences from Ableton Live. (These won’t be “real” MIDI note sequences, but virtual sequences where each pitch row is an on/off signalling trace for a specific hall effect sensor.)

This particular application aside, I am still somewhat astonished that the Arduino IDE supports a sizeable chunk of C++ (including inheritance and virtual methods), making the message formatting code pretty clean – I’m sure it’ll do the same for the sequencing engine, once we start to port that from MaxMSP.

Posted January 5th, 2011

Comments are closed.