Piezo Buzzer Keeps buzzing

Can anyone help me? I'm trying to get my buzzer so that it buzzes when i use the bush buttons. For some reason, the buzzer keeps buzzing when its just plugged in but the noises do work when i push in the buttons. This is my code :

#define NOTE_G4 392
#define NOTE_B4 494
#define NOTE_A4 440
#define NOTE_D4 294
const int buttonrPin = 1; // pushbutton 1 pin
const int buttonyPin = 2; // pushbutton 2 pin
const int buttongPin = 3; // pushbutton 3 pin
const int buttonbPin = 4; //pushbutton 4 pin
const int buzzerPin = 13;
void setup() {
//inputs
pinMode(buttonrPin, INPUT);
pinMode(buttonyPin, INPUT);
pinMode(buttongPin, INPUT);
pinMode(buttonbPin, INPUT);
//output
pinMode(buzzerPin, OUTPUT);

}

void loop() {
int button1State, button2State, button3State, button4State;
button1State = digitalRead(buttonrPin);
button2State = digitalRead(buttonyPin);
button3State = digitalRead(buttongPin);
button4State = digitalRead(buttonbPin);
if (button1State == HIGH) {
tone(buzzerPin, NOTE_G4); }
else {
digitalWrite(buzzerPin, 0);
}
if (button2State == HIGH) {
tone(buzzerPin, NOTE_B4);}
else {
digitalWrite(buzzerPin, 0);}
if (button3State == HIGH) {
tone(buzzerPin, NOTE_A4);}
else {
digitalWrite(buzzerPin, 0); }
if (button4State == HIGH) {
tone(buzzerPin, NOTE_D4);}
else {
digitalWrite(buzzerPin, 0); }
}

Please help

Please put your code in code tags (the first icon in the post dialog box).

How have you wired the switches?

If you have not included any pull down resistors on the switches, then please try this for all the inputs

pinMode(buttonrPin, INPUT_PULLUP)

But you will need to change the test to

button2State == LOW

and of course the else will need to check for HIGH

You may also want to look up using arrays rather than individual variables numbered 1, 2, 3, 4, etc as you can write much more compact code in this situation, using a loop.

Please edit your post, select the code, and put it between [code] ... [/code] tags.

You can do that by hitting the "Code" icon above the posting area. It is the first icon, with the symbol: </>

Read this before posting a programming question

How to use this forum

Some Arduinos have a LED attached to pin13, so try to avoid that pin.

A (mechanical) "buzzer" (with a + written on the side) can't be used to generate tones.
Only a "bare" piezo disc can.
Leo..