Monday, 10 May 2010

Welcome to the working piece...

Hi Again,
Since I last updated, lots has happened. Last Friday (only four days ago) I was keen to get this project underway. I went to Maplins with the list I had acquired from Charlotte and purchased the following:
1 x breadboard
3 x Light Dependant Resistors (of different values - low, middle, and high so the best could be found)
1 x 100KOhm Variable Resistor
1 x Bag of single stranded wire
1 x Cheap torch

With this I built the circuit using the previously mentioned blog.

After building this I used the Arduino2Max software - I opened the Arduino sketch in the Arduino sketch, and the Arduino2Max Maxpatch in Max/MSP.
Nothing happened.
Even when trying different LDRs nothing happened.
So I was disheartened, and then came the news of my mumps! That's right, I was horribly ill.
Today however, although I still resemble quagmire from Family Guy, I had a brainwave. The arduino software doesn't simply 'run' when opened. It is supposed to be uploaded to the arduino board itself so that it is programmed to do what I wish it to do.

So this instantly gave results! I had values coming from the board when the light changed around the LDR!
I spent a while testing each LDR and seeing which was the most ideal to use - it became apparent that the highest value LDR (120KOhms - 210KOhms) worked best due to it being the least sensitive, thus the range of values it gave were more controllable with the variable resistor.

Great, so all that was left was to jump into max and actually build something myself (the patch I was working with up until now to show the values coming from the Arduino are taken from the Arduino2Max software).
With knowledge gained from youtube videos and my friend Robert Taylor, I used the internal MIDI to not trigger a sample but to allow the values received from the LDR to control what note on the pianoroll was played in Max/MSP. This means as light passes by the pitch increases, and when it passes it decreases again.
I have recorded a short clip of this showing the status of the piece thus far.
Please enjoy:

My plan now is to figure out if (and if so, how) I can set up more LDRs to the breadboard and then I will most likely set samples for each LDR rather than having the MIDI pianoroll being controlled.
The voltage that is controlled to give the resistance and thus the values is the 5v from the Arduino board itself, my fear is that this cannot be split to multiple LDRs, meaning either I may not be able to do the piece with multiple samples OR it means that seperate power will be needed.. maybe in the form of 5v batteries? and if so, how?
I will be looking into this if need be.
For now, thank you for reading!
With luck I will be in good health in the next day or two as I feel better today, meaning I will be able to go out in public and sort things.
Alan Joesbury


  1. If this is 'first attempt' stuff, it's quite good. You can hook up 6 LDRs, and they'll all get 5v off the board.

  2. I wasn't too sure about splitting the power as I know nothing of electronics, but you're right. I now have three working - updating the blog with the news now.
    Cheers for your help Brendan!