Arduino CapSense-based Synth/Piano with custom sounds via Processing

Serial.begin() should be called only once, in setup().

Please fix the misplaced curly braces, and use Format (CTRL+T) to get properly indented blocks.

Your code will behave unexpectedly when multiple sensors are touched at the same time. It could be simplified into something like

  freq = 0;
  if (total1 > range) freq = 523.25;
  else if (total2 > range) ...
  ...
  if (freq > 0) tone(SND_PIN, freq);
  else noTone(SND_PIN);