   if (mode != SONG_MODE) {
     return;
   }
+
+  nextPartScheduled = true;
 
   clearLine(1);
   lcd.setCursor(0, 1);

  if (realtimebyte == STOP) {
    digitalWrite(bpmLed, LOW);
    playing = false;
    changeMode(NORMAL_MODE);
  }
}

  }
}

void handleBarChange() {
  if (mode != SONG_MODE || nextPartScheduled) {
    return;
  }
  clearLine(1);
  lcd.setCursor(0, 1);
  lcd.print(bars);
  lcd.print(" bars");
}

void RealTimeSystem(byte realtimebyte) {
  if (realtimebyte == CLOCK) {
    counter++;

    if (denominator > 0) {
      double increase = (1 / 24.0) * (denominator / 4.0);
      fullDenominator = fullDenominator + increase;

      if (fullDenominator >= numerator && numerator > 0) {
        fullDenominator = 0;
        bars++;
        handleBarChange();
      }
    }

    if (counter == 24) {
      counter = 0;
      digitalWrite(bpmLed, HIGH);
