void setup()
{
pinMode(2,INPUT); //do
pinMode(3,INPUT); //re
pinMode(4,INPUT); //mi
pinMode(5,INPUT); //fa
pinMode(6,INPUT); //sol
pinMode(7,INPUT); //la
pinMode(8,INPUT); //si
pinMode(9,OUTPUT);
}
void loop()
{
if(digitalRead(2)) tone(20,523,10);
if(digitalRead(3)) tone(20,587,10);
if(digitalRead(4)) tone(20,659,10);
if(digitalRead(5)) tone(20,698,10);
if(digitalRead(6)) tone(20,784,10);
if(digitalRead(7)) tone(20,880,10);
if(digitalRead(8)) tone(20,1046,10);
tone(9,330,800);
delay(880);
tone(9,392,400);
delay(440);
tone(9,587,1200);
delay(1320);
tone(9,523,800);
delay(880);
tone(9,392,400);
delay(440);
tone(9,349,1200);
delay(1320);
tone(9,330,800);
delay(880);
}