Modifiquei o ex. Melody e ele executa até uma parte depois para , já troquei "int" por "long" e não mudou nada .
O motivo pelo qual para é porque o resto da música não está programada. Podes fazer uma repetição passando o código para a função loop se preferires:
void setup() {
}
void loop() {
// iterate over the notes of the melody:
for (int thisNote = 0; thisNote < 71; thisNote++) {
// to calculate the note duration, take one second
// divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
int noteDuration = 1000/noteDurations[thisNote];
tone(11, melody[thisNote],noteDuration);
// to distinguish the notes, set a minimum time between them.
// the note's duration + 30% seems to work well:
int pauseBetweenNotes = noteDuration * 2.50;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(11);
}
}