it seems to me that when you say:
if (analogValue > thresholdTwo) {
...
}
if (analogValue < thresholdTwo) {
...
}
if (analogValue < thresholdThree) {
...
}
you should be more precise.
Let me give you an example of what i mean.
Let's say the analogValue is 80. Which file would you like to be played? Which of the if statements is true?
if (analogValue < thresholdTwo) {
...
}
or
if (analogValue < thresholdThree) {
...
}
?
In this case (if analogValue would be 80) both this functions would be true because 80 is smaller than thresholdTwo (500) and it is also smaller than thresholdThree (100).
You could maybe use && (AND) operators to define a better range of values when you would like an if statement to be true, something like
// value smaller the thresholdThree
if (analogValue < thresholdThree) {
// play file x
}
// value between thresholdTwo and thresholdThree
if (analogValue < thresholdTwo && analogValue > thresholdThree) {
play file y
}
... and so on to cover all the ranges you want to check.