int G3 = 395; // Sol rendah
int Z3 = 440; // La rendah
int B3 = 494; // Si rendah
int C4 = 523; // Do
int D4 = 567; // Re
int E4 = 659; // Mi
int F4 = 698; // Fa
int G4 = 784; // Sol
int Z4 = 880; // La
int B4 = 988; // Si
int C5 = 1047; // Do tinggi
int G5 = 1568; // Sol tinggi
int Z5 = 1760; // La tinggi
int B5 = 1976; // Si tinggi
int melody[]{
G4, G3, C4, C4, C4, E4, G4, E4, C4, E4, C4, G3, F4, E4, D4, C4,
C4, D4, E4, E4, E4, D4, F4, E4, C4, Z3, Z3, Z3, D4, C4, B5, Z5, G5,
G3, G3, D4, D4, D4, E4, D4, B3, G3, G3, G3, E4, E4, E4, D4, F4, E4,
E4, F4, G4, F4, Z3, B3, D4, C4, G3, C4, E4, G4, F4, F4, E4, D4, C4
};
int noteDurations[]={
4,8,2,2,2,2,2,4,2,4,8,2,2,2,2,2,
4,8,2,2,2,4,8,2,4,2,4,8,2,2,2,2,2,
4,8,2,2,2,2,2,4,2,4,8,2,2,2,4,8,2,
4,8,2,2,2,2,2,4,4,4,4,2,4,8,2,2,2
};
void setup(){
for(int thisNote=0; thisNote<67; thisNote++){
int noteDuration=1000/noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes=noteDuration*1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
void loop(){
}