Project 7, Multiple Buttons on Resistor Ladder

After some research and asking around I found a solution. The law of resistors in a parallel circuit is 1/R = 1/R1 + 1/R2. R is the total resistance and R1 and R2 are the resistances of the resistors. If you press the buttons of the 220 Ohm and the 1 MOhm resistors for example not a lot would happen because the total resistance would be 219,95 Ohm. That's almost the same as just pressing the 220 Ohm resistor. Hence pressing multiple buttons isn't not working.

The problem was solved when I used the 1k, 4,7k and 10k Ohm resistors. I just had to recalibrate the amounts of analogInput i received but pressing multiple buttons works fine! You can't combine the button without the resistor with another button however.

So now I have a keyboard which plays 7 different notes.

I hoped this helped and this is my code:

int notes[] = {262, 294, 330, 349, 392, 440, 494};
void setup() {
  Serial.begin(9600);
}
void loop() {
  int keyVal = analogRead(A0);
  Serial.println(keyVal);
  if(keyVal == 1023){
    tone(8, notes[0]);
  }
  else if(keyVal >= 925 && keyVal <= 935){
    tone(8, notes[1]);
  }
  else if(keyVal >= 690 && keyVal <= 695){
    tone(8, notes[2]);
  }
  else if(keyVal >= 510 && keyVal <= 515){
    tone(8, notes[3]);
  }
  else if(keyVal >= 940 && keyVal < 950){
    tone(8, notes[4]);
  }
  else if(keyVal >= 770 && keyVal <= 780){
    tone(8, notes[5]);
  }
  else if(keyVal >= 950 && keyVal <= 955){
    tone(8, notes[6]);
  }
  else{
    noTone(8);
  }
}