How to update a counter in a void loop

I wrote a program to play bit music using my Nano and a small piezo buzzer. Everything works fine except it won't update the counter I set up to change the song when I press the rotary encoder. If I remove the function that plays the song, it will update the counter and move on to the next song but then gets stuck again. I'm using a state machine to update the counter. Each button press should increase the counter by 1. Can you guys help me please?

void loop() {
  switch(State) { //Switches between states
      case A: //A state
              if(digitalRead(Push) == LOW) {
                Timer = millis(); //Records time to Timer
                State = B; //Sets state to B if button read is LOW
              }
              break;
      case B: //B state
              if(digitalRead(Push) == HIGH) {
                State = A; //Sets state to A if button read is HIGH
              }
              else if ((unsigned long) (millis() - Timer >= 5)) { //Timer
                Indicator = 1; //Sets indicator to 1
                State = C; //Sets state to C
              }
              break;
      case C: //C state
              if(digitalRead(Push) == HIGH) {
                State = A; //Sets state to A if button read is HIGH
              }
              break;
    }
  
    if (Indicator == 1) {
      Indicator = 0; //Clears Indicator
      Count += 1; //Adds 1 to Counter
  }

 //Plays different song upon button press
    if(Count == 0 ) {
      LcdDriver.setCursor(0,0); //Sets cursor
      LcdDriver.print("Press Button"); //Prints to LCD
      LcdDriver.setCursor(0,1); //Sets cursor
      LcdDriver.print("To Start"); //Prints to LCD
    }
    if(Count == 1 ) {
      LcdDriver.clear(); //Clears LCD
      LcdDriver.setCursor(0,0); //Sets cursor
      LcdDriver.print("Hello by Adele"); //Prints to LCD
      hello(); //Plays song
      delay(5000); //Pauses for 5 seconds and plays again
    }
    if(Count == 2 ) {
      LcdDriver.clear(); //Clears LCD
      LcdDriver.setCursor(0,0); //Sets cursor
      LcdDriver.print("Star Spangled Banner"); //Prints to LCD
      star_spangled_banner(); //Plays song
      delay(5000); //Pauses for 5 seconds and plays again
    }  
    if(Count == 3 ) {
      Count = 0; //Sets count to 0
      Indicator = 0; //Sets Indicator to 0
    }
}

In this section,

  }
  
    if (Indicator == 1) {
      Indicator = 0; //Clears Indicator
      Count += 1; //Adds 1 to Counter
  }

change the Count ++; as opposed to Count +=1 and try that.

Bill

count++ and count += 1 are the same thing.

Try this:

byte count = 0;
const byte button = 2;



void setup() {
  pinMode (button, INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);
}


void loop() {

  count += buttonCheck();   // add 1 only when button has been pressed

  switch (count)
  {
    case 0:
      // songs go here
      break;

    case 1:
      break;

    case 2:
      count = 0;   // reset after the last song
      break;
  }
}


byte buttonCheck()   // Returns a positive result Once per press
{
  static int isButtonPressed = 0;

  if (digitalRead(button) == LOW)   //  button reads LOW when Pressed
  {
    isButtonPressed++;              // Increment Debounce variable
  } else {
    isButtonPressed = 0;            // if it bounces reset
  }

  if (isButtonPressed == 10)    //number of consecutive positive reads to be accepted as a legitimate press
  { // Adjust as needed
    return 1;               // Confirmed button Press
  } else {
    return 0;               // button not pressed
  }
}