processing & photoresistor

hello

im designing a project with arduino + processing.
basically, a photoresistor (LDR, light sensor, what ever you know it as) will be placed on a guitar to pick up hand movements.
processing will play 1 of 8 songs each time a hand moves within a certain range of the guitar.
so,
input: if hand moves within specified range,
output: play 1 of 8 sounds (sound will be looped)
input: if hand leaves that range,
output: sound stops
input: if hand returns within range,
output: next sound plays

so, as long as the hand moves to and from the guitar, the sounds will play consecutively: 1 of 8, 2 of 8, 3 of 8, etc.
and as long as the hand stays within the range, whatever song is playing will loop itself.

what i need urgent help with is the coding to make this happen.
i have a basic code for arduino:

int analogInput = 0;

int inputPin = 0;

void setup()
{
pinMode(inputPin, INPUT);
beginSerial(9600);
}

void loop()
{
analogInput = analogRead(inputPin);
analogInput = analogInput/4;
Serial.println(analogInput, BYTE);

delay(50);
}

----------- for processing, it’ll be something along the lines of:
if (input < 800)
int n = 1
sounds[n].play();

right? am i at least starting properly?

as you can see i’m a long way away from completion
please help