Main

April 25, 2008

The Weather Box

I completed my final project for Networked Objects, working with Lesley Flanigan.

Our original idea had been to retrieve weather information from the Internet for different cities, and use this as the basis for a simple melody. This basically what we delivered:

Built into a Fortnum & Mason tea box, is an Arduino-based polyphonic synthesizer, with an XPort Internet access module. The dial allows choosing any of 8 cities. When it is turned, the box retrieves the weather information for that city from an NOAA server, and turns it into a simple melody. Pressing the red button will replay the melody. If for any reason the box cannot establish an Internet connection, it will use the data it last retrieved for that city, which it has stored in the Arduino's on-board EEPROM.

Continue reading "The Weather Box" »

March 04, 2008

Headphone Heterotopia - tech notes

Here are some notes on Headphone Heterotopia, a project I am working on with Lesley Flanigan.

A simple box with a selection dial and a headphone jack allows you to pick a city, and experience realtime weather data from that place as a simple musical phrase.

What is happening inside the box: an Arduino microcontroller uses an XPort network controller to fetch weather data from the NOAA (via a PHP script that simplifies it), and uses it to play a melody using an audio circuit based on digital potentiometers and simple oscillators.

Most of the technical issues are now resolved: the microcontroller is successfully parsing the weather data, and feeding it to the audio synthesis routines. Still need to set up the selection mechanism for multiple cities, and build an enclosure.

Here's a picture of the guts of the thing:

weather synth

Read the past the jump for detailed description and technical issues.

Continue reading "Headphone Heterotopia - tech notes" »

December 19, 2007

Performance at NIME/Algorithmic Composition Show

I played the Mutation Synth at the NIME/Algorithmic Composition show, at Exit Art.

playing the mutation synth

It was very exciting to hear the Mutation Synth connected to a really loud sound system - I had only listened to it through headphones until then. There is a short video of me playing the synth here. Unfortunately the sound is not great, I'll be posting some samples from the synth a bit later.

I was very pleased with the instrument: a couple of last minute changes made it much more interesting to perform with. The ability to save and restore states of the system allowed for much more drama in performance. As expected, the technique of bringing back a saved state then letting it "mutate" in different directions was a good way of structuring a performance. Without this, the changes are always too gradual - it is very difficult to make dramatic transitions.

I also made another change just before the performance, which was to only allow mutations at the end of each melodic phrase. This had the effect of slowing down the mutation rate (from 400 times per second to 2!) and making the repetition of the note phrases that much more apparent.

Continue reading "Performance at NIME/Algorithmic Composition Show" »

December 01, 2007

Progress on the Mutation Synth

I built a prototype (and probably final model...) of the case for the mutation synth.

Here it is in all its finely crafted glory:

mutation synth case

I have a bad habit of always leaving physical construction until too late, and it always takes longer than expected. After shattering yet another sheet of acrylic, I went to the hardware store and bought a proper set of drills.

Once the physical model is built, however, testing the performance of a system becomes much faster, and more interesting. However, I tend to spend too much time testing and refining the software and electronics before really thinking about construction, let alone performance...,

What does it do?

The four toggle switches at the top control whether mutation is happening (or not happening) for four parameters of the music.

The four knobs control the intensity of mutation. Some of the parameters have a directionality. In this case, centering the pot slows mutation, moving it to either extreme expresses that valence (eg. overall pitch up or down, mood happy or sad, etc.) The parameters I'm working with now are transposition, permutation, rhythm and sound type. In effect, the pots allow you to tighten or relax the fitness equation, much like a genetic algorithm.

The two rows of four buttons allow saving and restoring the state of the synth. If you come across a mutation that sounds good, you can save it into one of four slots, and just as easily recall it.

I am trying to avoid control over individual voices - I like the model of interacting with an algorithmically generated "ensemble". I will probably end up making two of the voices "altos", two "tenors" and the last two "basso" drones. However, I might add individual cut switches for each voice.

November 20, 2007

Arduino plays Steve Reich

In the latest iteration of my Arduino Audio project, I have now set it up to play Steve Reich's "Piano Phase" piece, inspired by ASDF;'s innovative performance of the same.

Click here for a sample

and to prove that all 6 voices are working, here's a version with 6 "pianos" all gradually drifting in and out of phase.

Click here for the 6 voice version

November 18, 2007

Algorithmic sound on the Arduino

My final project for Performing Technology and Algorithmic Composition is to build a "hybrid instrument", one that will take input from a performer but also generate significant parts of the output via algorithmic means.

I want to make this instrument self-contained, so I've been working on a polyphonic sound synthesis technique using the Arduino microcontroller.

Today I implemented the "Seven Bridges of Konigsberg" assignment entirely on the Arduino.

Click here to listen to a sample of the output from the Arduino.

Click here to compare it to the Processing + Csound version.

Getting to this is an important milestone, since I have ended up building quite robust systems for scheduling and manipulating sounds using this synthesis technique.

November 16, 2007

Replacing pots and caps for better sound

I've been working on building a multi-voice synth engine for the Arduino, using digital pots and simple VCO's (voltage controlled oscillators). However, my initial tests, though reliable, were pretty limited in the range of tones I could produce.

The following spectrogram was generated by a test program running on the Arduino synth engine, that ran values from 0 to 255 through the digital pots used to control oscillator frequency. The horizontal axis is time, in seconds, the vertical axis is frequency. The brightest line is the dominant frequency, the smaller ones are harmonics generated due to the waveform being a square wave.

old calibration

I was using 10k ohm digital pots, and a 1mf capacitor to drive the oscillator. (A VCO works by charging and discharging a capacitor through a variable resistor.) The useful frequency range obtained is basically from 100hz to 700hz - not much at all. In addition, the 100hz range was reached pretty quickly, about a third of the way through the digipot's range. After that, it degenerated into dissonant ticking sounds.

So I replaced the 10k digipots with the equivalent 50k ohm part, and the capacitor with a 0.1mf part. A smaller capacitor takes less time to charge, and hence allows a higher frequency oscillator. At the same time, the higher resistance value on the digipot allows for a much reduced voltage to be applied, which means that lower frequencies are still possible.

The following chart shows the results of this new configuration. The range of frequencies is now from 70hz to 7000hz, more than a tenfold increase from the previous. Also, far more of the intermediate steps are usable, which will allow for much tighter tuning.

new calibration

October 20, 2007

Generating polyphonic sound with Arduino

A lot of projects could use high-quality musical sounds generated without the use of a full-blown computer. Currently, there are two main options:

1) Generate sound by toggling the digital outputs on the Arduino
2) Use an external sound generator, say a hacked MP3 player

Each of these methods has a drawback: for the first, the Arduino is too slow to generate multiple simultaneous audio tones AND do anything else, eg. significant amounts of I/O or communication; for the second, you are limited to whatever sounds are already stored in the MP3 player, and it is costly.

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.

Here is a sample: Random scales and tempo, with envelope shaping

Here is a photo showing the Arduino Mini connected to the AD5206 and the 47C14. Another photo showing the USB adapter and the stereo output jack more clearly is here. (Disregard the other, smaller breadboard layout, it has nothing to do with the Arduino audio project.)

Audioino

Only two oscillators are connected, but they are working for both frequency and amplitude modulation. There is a 4093 NAND on the board, but I am currently not using it. At first I thought I could use the the additional gate for modulation, but it turns out that amplitude modulation with the AD5206 is fast enough that this is not necessary. I will replace the 4093 with another AD5206 to allow for 6 fully controllable voices.

In a nutshell, I am using a 74C14 Schmitt Trigger hex inverter to build a number of standard resistor/capacitor oscillators. For each of these, the variable resistance value (ie variable voltage) is provided by one of the digital pots on the AD5206. In addition, the output from each oscillator is fed back to another pot on the AD5206, which is used to modulate amplitude. This allows applying modulation envelopes to the generated tones.

The resulting sounds are high quality, and can be calibrated to match musical note tunings.

This method has tremendous advantages:

1) Low cost: total cost of the AD5206 + 74C14 + various capacitors is less than $5, which allows for 3 voices. Adding another AD5206 for $4 allows for 3 more voices.

2) Low processing requirement and timing independence: the AD5206 will maintain the state of its digital pots without needing refresh - this allows the logic on the Arduino to run at music rates (eg. beats, on the order 10s of the times per second) instead of at audio frequencey rates (on the order of 1000s of times per second). Furthermore, unlike software generated sound on the Arduino, sound pitch will be completely unaffected by the speed of the main loop on the Arduino.

3) Efficient use of Arduino I/O: you can implement 3 voices with only 3 digital output pins on the Arduino. By adding 1 more digital output (total of 4) you can control 6 voices. All the other digital and analog ports on the Arduino are free for other uses.

Next steps, in order:

Implement flexible envelope shaping, either by direct download of a lookup table, or by calculating on the Arduino based on ADSR parameters.

Implement possibility for frequency modulation envelopes.

Implement greater compatibility with MIDI standards, allowing MIDI note numbers to be played directly.

Implement microcontroller + digital pot + oscillator circuit on an etched circuit board, this would allow an extremely compact and self-contained audio solution.

June 27, 2007

Finished the synth

I finished my synthesizer project! The last touch was to to connect the four switches, which choose the phase of the modulation signal. This means that when two oscillators are modulated at the same rate, you can choose whether they sound at once, or alternately.

CMOS Synth

I've put a couple of MP3s recorded from it online here and here.

I found (you may disagree...) that it allows for a striking degree of control and expression, just by turning 4 knobs for pitch, 4 knobs for modulation, 4 switches for phase and one last knob for overall tempo.

Next steps with this project:

* add an amp within the case, so speakers can be powered directly
* add speakers - maybe on stalks, coming out of the currently empty front of the case
* add some kind of controllable distortion circuit
* etch the circuit board

June 20, 2007

CMOS Synthesizer Project

I'm taking a summer class called Systems, or more popularly, "Hacking Everyday Objects". I felt I needed to get back into the lab, and actually build stuff.

My project (now approaching completion) is a compact rhythmic synthesizer, based on circuits and concepts from Nicolas Collin's book "Handmade Electronic Music".

Here's a picture:

CMOS Synth

My original plan was to build it into a surplus Sony professional tape deck, but I decided I didn't really know enough to do more than just use it as a case. Instead I'm using the enclosure from an old Iomega CD-ROM drive.

I'll post recordings of sample output. It sounds interesting - using only a few simple chips, it generates elaborate polyrhythmic structures.