What's wrong with my code?

I'm trying to make a piezo buzzer "piano" with two push buttons, each making a different tone. It works with one push button, but when I try to add another, it doesn't work.

const int buttonPin1 = 2;
const int buttonPin2 = 4;
int Buzzer1 = 9;

// variables will change:
int buttonState1 = 0;  
int buttonState2 = 0;

void setup() {
  // initialize the piezo as output:
  pinMode(Buzzer1, OUTPUT);  
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin1, INPUT); 
  pinMode(buttonPin2, INPUT);    
}

void loop(){
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  if (buttonState1 == HIGH) {     
      tone(Buzzer1,400,200);
      if (buttonState2 == HIGH) {
        tone(Buzzer1,450,225);
      }
  }
}

What's wrong?

You've nested the if statements. The second button only gets checked if the first is pressed. Move the second if statement out of the block for the first one.

Or Press both buttons!

Mark

const uint8_t   pinBUTTON_1  = 2;
const uint8_t   pinBUTTON_2  = 4;

const uint8_t   pinBUZZER_1  = 9;

const uint8_t   BUTTON_UP   = LOW;
const uint8_t   BUTTON_DOWN = HIGH;

void setup()
{
    pinMode(pinBUZZER_1, OUTPUT);  

    pinMode(pinBUTTON_1, INPUT); 
    pinMode(pinBUTTON_2, INPUT);    
}

void loop()
{
    // LOCAL VARIABLES TO CAPTURE BUTTON STATE DECLARED CONSTANTS TO GUARANTEE
    // THEY CAN'T BE CHANGED THIS 'loop' ITERATION

    const int stateBUTTON_1 = digitalRead(pinBUTTON_1);
    const int stateBUTTON_2 = digitalRead(pinBUTTON_2);

    if ( BUTTON_DOWN == stateBUTTON_1 ) { tone(pinBUZZER_1, 400, 200); }
    if ( BUTTON_DOWN == stateBUTTON_2 ) { tone(pinBUZZER_1, 450, 225); }
}