(n00b) multiple ifs, general programming mishaps, and learning to program

I don't understand this bit:

  int LDRVal = analogRead(LDR);
  int musicValue = LDRVal % 10;

Suppose that there are minor changes in the light level, and on three successive iterations of loop, LDRVal is 349, 351, and 348. The values in musicValue will be 9, 1, and 8. I don't see any good correlation between the tone played and the level of light.

I suspect that the modulo function is not what you want to be using. I suspect that you want to divide the range of the sensor output into 10 parts, and play different tones as the light level changes significantly, not as it jitters.