After working in this project for a month, I must say that my expectations where very high and communication between Processing and Arduino is much more complex than I thought! But I can not complain about the process and all that I learned, and the outcome was actually very nice.
My intention with this project was to create a kinetic artifact that would react to the music that was being played. It all started when I was invited to collaborate in a small world music improvisation concert. I thought of making a structure that would somehow modify the space with the actual input of the live music. In the end I was not able to create a working mechanism for the concert in large scale, but the whole project served as inspiration for my final project.
Here the link to the music that I used for the project:
So, basically what I worked on was first a code in Processing that would take the music and analyze the frequencies with a fft. library, plus dividing the sound frequencies in 16 blocks. Then it would read the amplitud of each block and send the array to Arduino.
I then made a code for Arduino and selected the values from two frequency blocks. Arduino would Serial Read and react by turning a motor left, right or off, through an H-bridge, depending on how high the value was.
There where two motors: one for each frequency block; in turn each motor moved a filter layer over a light source.
That was the mechanical part of the project:
It consisted of two motors with gears.
Connected to the PCB board and Arduino.
The motors needed a separate power source, and each motors was turned ON (left or right) and OFF through its own H-Bridge. (It was necessary to separate all of these elements to protect the Arduino board from the voltage)
Then, each motor by turning would activate levers that moved each a Filter.
One color filter was fixed to the structure, the second one was also colored and it slides horizontally on its own rail, and the third one played with silhouettes and moved randomly in its area.
The whole filter structure was placed on top of a spotlight, and the light was projected through all the moving filters.
I used a semitransparent surface to project the light on to it and this is what it looked like.
Here is then a short video of how the whole setup looked like for the exhibition.
The music was played into the computer using Soundflower, and the visitor could hear it through headphones. The screen of the computer showed the frequency reading of Processing and next to it one could see the light patterns moving subtly to the music.
The Final idea would be to project this light on to the whole room or at least the ceiling, thus creating an atmosphere that would react to certain tones or movements in the music. Processing would be able to obtain the music data also in a live concert, through the sound mixing console or a microphone.
Here the link to a video withe the inner workings of the project.