Thursday, 13 May 2010

The end is nigh...

And that's Hi very possibly for the last time for this project, as the project is pretty much complete.

So, from where we left off last time then..

I had made a breakthrough in getting one LDR triggering MIDI within Max/MSP.
So I had a wonder over to the Max/MSP forum ( and asked for help with my single remaining problem (unless you count building the piece as a problem, but I didn't). I needed Max/MSP code to read the value from an LDR and use it to trigger a sample - much more than just the MIDI piano sound I already had. This required actual knowledge of Max!
So a member of the Max/MSP online community called Brendan stepped in and gave me a patch that did exactly what I wanted. The user gives a value (or two values that it will react between, but in my case I gave it a single value to work with) and this creates a 'bang' which, with help from Robert Taylor I had playing samples that I created - simple sine waves using Logic.

Now that the patch was there I needed to build the beast, and I have done just that.
I only had to purchase two extra LDRs (which use a slightly lower range of Ohm-age as Maplins ran out of stock of the most ideal LDR), as well as three variable resistors - one for each LDR. The first had managed to set itself on fire during some testing before. Using tape to attatch the LDRs to various things I attatched two new LDRs, one to a cardboard box and the other to the top of a pringles tube. It's nice to give it a 'bodged' home-made feel. The other advantage was saving money on purchasing breadboards when I had already bought enough breadboard real estate to fit the resistors on.

So stick a fork in me, I believe I'm pretty much done.

Here is a very brief video of the piece:

I'll do another using different samples and more accurate readings in Max very soon.

The issues that still remain are:
A) The sensitivity of each LDR could definitely improve, only time spent tweaking it will cure this problem.. which brings me to my next issue..
B) If this piece is presented at the Confetti showcase, the values given from the LDRs will differ throughout the day if presented in a room with a window, as the amount of light that leaks in will change - this means the values that the samples must be triggered at must be changed slightly throughout the day to accommodate for this.
C) This final issue is minor. To put it simply, the sine waves are quite boring and ugly sounding, especially when repeated so often. I may create a drop-down list in Max/MSP so that different samples can be loaded at the users discretion.

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

Thursday, 6 May 2010

Leaps and bounds

So it took me longer than expected to get in touch with Charlotte from the Radford maplins store, but I did just have a conversation with her and I am set to begin my project properly.

What I haven't mentioned, but what is important is that I now have an Arduino board!
I ordered it a few days ago and it came today. But anyway, here's what I've learnt from talking to Charlotte and explaining to her info on this blog that I found on connecting LDRs to an Arduino:

I need to purchase a bag of single core wire, a breadboard, and a few LDRs that deal with different ranges of resistance as well as a variable resistor.
So using the blog and the knowledge gained from Charlotte, I know how to connect the bits together and simply need to test different LDRs in the circuit. This is because although I can fine tune the resistance with the variable resistor, I need to choose an LDR that already has a suitable resistance as it could be too resistance or not resistant enough when the light passes over it.

So my project is in motion now, and with luck I could have it working by this weekend! All thanks to Charlotte from Maplins and her extensive knowledge of electronics.

I'll buy the bits tomorrow, and update you then. For now I am installing Arduino software.
Alan Joesbury

Saturday, 1 May 2010

Possibly a pretty pointless post

Hello again,

After my previous post explaining that I needed to return to Maplins on Friday to speak to this 'Matt' fellow (if this is his real name) it became apparent that 'Matt' is no more - for at least a week whilst he is on holiday. So I was told to pay them another visit today (Saturday) to speak to another guy who may well know about electronics.

I put on my finest shoes and strolled on down merely an hour ago, only to find that this new fellow (Simon maybe?) has a very limited knowledge of electronics and circuitry (apparently he learnt nothing from a six week course).

Anyway. Long story short, the research goes on and I can contact a lady called Charlotte tomorrow in the Radford Maplins store who studies electronics at University.
But will she simply fob me off like the others?

I will update the blog tomorrow with news from Charlotte - another person from the ever growing Maplin's team of 'experts'.
Good day,
Alan Joesbury