Unconventional but possibly workable....
Not the solution to your problem, but why are you using digital pins to provide the 5V to the sensors ? Why not just connect them to 5V ?
The note produced isn't in the program, but is close to the average of all of the notes
That does not make sense. To quote from the tone() function reference page
Only one tone can be generated at a time. If a tone is already playing on a different pin, the call to tone() will have no effect. If the tone is playing on the same pin, the call will set its frequency.
Can I suggest that you add a Serial.print() just before each tone() and noTone() so that you can track which sections of the program are being activated ?
Personally I prefer to use braces to hold blocks of code in if/else even if only one line of code is to be executed, like this
if (val_1 < threshold) // if a value drops below the threshold
tone (speaker, Note_C);
} // a note is played
I find it much easier to visualise what is going on and if later I add other lines of code, such as I suggested above, there is no confusion as to which code will be executed.