First things first: Thank you to my husband Joseph Gray for helping me with designing the box and with the initial setup and testing of the Arduino components. Also, a huge thank you to my teacher Ben Kamen who gave me so much great feedback and helped me every time I hit a wall creating the Max patches.
So here it is. One of my latest endeavors, an interactive mini sound installation, created using Max MSP and Arduino.
The Tools
Wiki says it best “Max MSP is a visual programming language for music and multimedia…” Below are a few screenshots showing segments of patches used in the installation.
“Arduino is a single-board microcontroller designed to make the process of using electronics in multidisciplinary projects more accessible…”
The Vallecula is an installation that utilizes 20 different custom Max MSP patches, triggering 100 vocal samples. The piece was presented at the Northern in Olympia, Washington on June 5th. Samples of what composed by the audience using the controller can be heard below.
The Arduino makes it possible for the controller to communicate with Max and many other programs. There are a total of 12 digital ports, that communicate with 1’s and 0’s. The Arduino also has 6 analog ports, that communicate using voltage, 0–5 volts.
I used 8 digital ports for my buttons and switches and 4 analog ports for my knobs. When the buttons are pushed it triggers the message to change from 0 to 1, that 1 can be used to trigger whatever you like in Max MSP. On my controller I use it to trigger patches that include: generation of random tones (samples) and random rhythms, reversing the direction of all samples, controlling tonal shifts and triggering single samples. As you can see, the message from the digital ports is super simple, but you can use it to trigger whatever you like.
The analog ports are a little more complex, but not much. There is a voltage of 0–5, which shows up as a number between 0 and 1023 in Max, you can write a simple patch to convert this to any range you want to. In Max MSP the object box used to convert the information reads like this [scale 0. 1023 100 40]. This simply converts the range of 0 to 1023 to 100 to 40. I used this particular range to control tempo, so the tempo range was 40 bpm to 100 bpm. For the shift in tone the same command looked like [scale 0 1023 2. –1] raising the pitch of the piece up 2 half steps to down 1 half step.
Concepting and Building
I wanted to create something that could be controlled by anyone, any age, at any level of technical or musical understanding. I want each person to create a unique composition and to be empowered by acting as composer.
How much control should I give the user? What would be randomly triggered by Max, and what would be set?
I used the Eb harmonic major scale for the composition. The idea of having more variety and compositional outcomes was exciting, but I didn’t want to do it at the expense of the user experience. It needed to sound good and be easy to use. Each patch needed to take up a different dynamic and spectrum of sound. It took awhile to find timbres that sounded good together and stood out on their own using only voice to generate the samples.
The first patches were triggered manually, so I could bounce around some ideas before I started using the controller. I started with recording the long chords and building the patch that would trigger them. Each of the middle buttons have an assigned set of long tone chords, each time you trigger the button it plays the same chord.
The melodic burst were next. Each time you press a button it randomly selects one of 16 single tone samples. The rhythmic pattern for triggering the samples is also randomly generated. Random in this case means that it selects from a 5 different note lengths, so not random in a sense that anything can happen, but random in that there is variation every time you hear the burst. Each sample is a recording of me layering my voice on one note, exactly 250 milliseconds in length. The samples are selected notes from a Eb harmonic major scale spreading over 2 and ½ octaves. Random, but I have do have it it triggering the tonic and 3rd and 5th twice as often as the other tones.
Once I had these beginning ideas in place I made a few designs for the the box, deciding on how many buttons switches and knobs I would have and what they might eventually be used for. I purchased the components at Radio Shack. The one on Queen Anne has a good selection (inside tip from Joe). Once I had all the buttons and knobs I measured the shaft width of all the components. Joe and I worked together to create the design for the box. Joe had already created a generic controller called the projBox and we created a design based off of the original model to suit the projects needs. We then had the box laser cut at Metrix Create Space.
Then started the process of assembling the Arduino, testing all the components, wiring and soldering once everything was in place.
When wiring the Arduino you must make sure every component is grounded. Here we are testing the knobs and switches.
I glued the box together and used screws to secure the Arduino and breadboard to the bottom of the box.
After installing the Arduino and breadboard I dry assembled the circuits.
Then I soldered the components and wiring at Metrix Create Space…
…and completed the wiring between the breadboard/Arduino and the components.
In my last blog I mentioned that I had a frustrating time testing the Arduino. I was having trouble finding the code to get it to work with Max. I couldn’t find anything using the word Arduino in the Max tutorials, the information is in the section talking about serial ports. The Arduino is a serial port device.
At this point I was able to assign the buttons and knobs to the patches I had already written. I had long tones, the melodic bursts and a bass line. The base line turn out to be annoying. One of those ideas that you think will be good and when you hear it you know it’s not.
I assigned the these all to buttons and then started working on creating patches for the knobs. Knob 1 was a volume control for the lame bass line and knob 2 controlled the tempo of the bass line.
At this point I was in the middle of it and needed some feed back. What did people want it to be able to do?
I brought this version into the class for people to interact with and I got some great feedback. I can’t remember the suggestions I didn’t take but I do remember the ones I did take. It was suggested that I use words or do a poem of some kind, that I have a button to reverse the samples, that I did not have a continuous bass line and that I create something to mess with the global tempo not just one patch.
In order to raise and lower the pitch I had to trigger all the samples in Max using groove instead of play. With groove you can do more with samples, like raising the pitch and reversing the sample direction. So I rewrote all the patches for the first time. I rewrote all the patches multiple times, part of the learning process. I would go in with a completely crazy looking patch and Ben would say, “you know there is an easier way to do that.” So I would take apart my hours of hard work and learn I could have done the same thing in a quarter of the time.
I could go on forever about the details and intricacies of the rest of the process, what I tested, what I kept and what I trashed, but then this blog would go on forever. I did want to talk about the very beginning stages though because I think it is interesting the way things take on their own life and just how important good feed back is when you are new to a way of thinking and creating. Something I very much appreciate about the music technology community so far is how sharing is part of the culture, there is very little hoarding of ideas or fear around someone stealing some technique or tool, it’s all good if someone uses something you created and builds on it, as long as they give you credit.
So, here is a summary of the final product and a brief description of the patches that were used.
* Digital triggers for center buttons, that trigger samples of sung slow chords
* A digital trigger for the right round button that triggers the melodic bursts made up of a random selection of 16 samples and randomly selected rhythmic patterns. The samples are made up of 16 tones that are part of an Eb Harmonic Major scale ranging 2+ octaves
* A digital trigger for the left round button, triggers the poem section. The poem is made up of two verses. Each word in the poem has 3 different note choices, so although you hear the same words every time it is a different melody each time the poem is triggered. Each verse of the poem uses call and response, we hear the first words panned hard right and a repetition of the word immediately at a lower volume panned hard left. The second verse is panned opposite of the first. The first verse uses a random generator for the note duration and the second verse has a consistent rhythm. At the end of each verse there is a backwards sample of one of the phrases in the poem. (When reversed the backwards phrase is the only part you can understand)
* The upper left knob manipulates the pitch center of the entire piece. By twisting the knob you can raise the pitch up a minor third
* The lower left knob controls the tempo of both the poem and melodic bursts
* The left on/off switch controls direction of all samples
* The right on/off switch shifts the melodic bursts up an octave
* The knobs on the right control the LFO frequency and depth causing a tremolo effect for the long chords and ring modulation for the melodic bursts