Author Archive

Small-Scale MIDI for the Music Box

We’ve spent a bit of time working with the ATSAM2195 synthesiser chip on the Fluxamasynth board that we’re using for the Modular Music Box.

The ATSAM conforms to a bewildering selection of MIDI specifications: as well as responding to core MIDI messages, it supports General MIDI, The Roland MT-32 sound set, Roland’s GS MIDI extensions, a bunch of additional NRPN and SysEx controls and its own “DREAM” command set. There are at least three completely different ways to control the device’s master volume, and three more to control per-channel part volumes. Having skimmed the manual a few times, we embarked on a near total rewrite of the Fluxamasynth support library to layer out the various classes of parameter and SysEx change.

The ATSAM’s sound, and voice architecture, are pretty similar to the MT-32: there are some rather wimpy voice-specific low-pass resonant filters, rudimentary LFO and envelope controls, a dual effects processor, built-in parametric EQ and (apparently) sound spatialisation. The sound quality is probably not something you’d want to commit to an album (despite the fact that the MT-32 was a hot studio item in 1987), but it’s pretty impressive from something the size of a lentil.

Screenshot of Max for Live bridge

For testing, we have the Fluxamasynth – essentially the ATSAM chip on a bare-bones Arduino – connected via I2C to an Arduino Mega as “host”, with the Mega running a protocol layer for talking to a MacBook. The Mac side of the link is implemented in Python within MaxMSP, which means we’ve been able to drop the entire thing into Max for Live and play bits of Beethoven and Mozart from General MIDI files directly through to the ATSAM. The tracks sound… acceptable. (The onboard EQ will help a lot.)

Next task: code up some sequences that will work on the music box’s playback disc: 64 steps, 13 pitch rings. That’s not very much Mozart, so quite a bit of manual quantising will be necessary to shoe-horn pieces into a playable form which will last more than four or five seconds.

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. (more…)