         else{tone(8, 5100,100);}
         delay(1000);
     }
-    goto start1;
+    return MODE0;
+}
 
-
-    music1:
+int music1(){
     delay(500);
     buttonState=1;
     for (int thisNote = 0; thisNote < 82; thisNote++) { 
        buttonState=digitalRead(9); 
-       if (buttonState ==LOW ) {goto music2;}
+       if (buttonState ==LOW ) return MODE2;
        if(thisNote == 0){
             digitalWrite(5,LOW);
             digitalWrite(6,LOW);

        int pause = duration * 1.5;  //音符の間で時間をあける
        
        delay(pause);
    } 
    goto music2;  
}

        int pause = duration * 1.5; //音符の間で時間をあける
        delay(pause);
    }
    return MODE1;
}

int music2(){
    delay(500);
    buttonState=1;
    digitalWrite(0, LOW);
