Looper project - Time line

Hello. I have my project guitar looper,

part of my code is

void REC() {



  debouncer7.update();


  if ( debouncer7.fell () ) {
    rec = 2;
  }

  switch (rec)

  {
    case 1 :

      break;
    case 2 :

      midiOUT(0x90, 0x60, 127);
      TimerA = millis();
    
      lcd.setCursor ( 0, 3 );
      lcd.print("LOOPER: PRECOUNT    "); 

      rec = 3;
      break;

    case 3 :
      if (millis() - TimerA >= ((((msPerMinute / bmp)*pattern) / 4))) {

        rec = 4;
      }
      break;
    case 4 :

      midiOUT(0xB0, 0x63, 0x7D); 
      midiOUT(0xB0, 0x62, 0x58);
      midiOUT(0xB0, 0x06, 0x00);
      midiOUT(0xB0, 0x26, 0x01);
      delay(1);
      midiOUT(0xB0, 0x63, 0x7D); 
      midiOUT(0xB0, 0x62, 0x58);
      midiOUT(0xB0, 0x06, 0x00);
      midiOUT(0xB0, 0x26, 0x00);
      delay(1);
      MIDI.sendSysEx(13, Tap_on, true);
      lcd.setCursor ( 0, 3 );
      lcd.print("LOOPER: RECORD +    ");
      digitalWrite(ledPin_1_2, HIGH);
      rec = 5;

      break;

    case 5:


      TimerA = millis();
      rec = 6;

      break;

    case 6:
      if (millis() - TimerA >=  ((msPerMinute / bmp * takt / 4) + beats)) {
        rec = 7;
      }

      break;

    case 7:
      digitalWrite(ledPin_1_3, HIGH);

      midiOUT(0xB0, 0x63, 0x7D); // 
      midiOUT(0xB0, 0x62, 0x58);
      midiOUT(0xB0, 0x06, 0x00);
      midiOUT(0xB0, 0x26, 0x01);
      delay(1);
      midiOUT(0xB0, 0x63, 0x7D); // 
      midiOUT(0xB0, 0x62, 0x58);
      midiOUT(0xB0, 0x06, 0x00);
      midiOUT(0xB0, 0x26, 0x00);
      delay(1);

      MIDI.sendSysEx(13, Tap_Off, true);
      digitalWrite (ledPin_1_2, LOW);
      digitalWrite (ledPin_1_3, HIGH);
      autolooper = 1 ;

      TimerB = millis();


      lcd.setCursor ( 0, 3 );
      lcd.print("LOOPER:  PLAY >     ");
      rec = 1;

      break;

    default:
      rec = 1;
      break;

  }

  if ( millis() - TimerB >= tempo)
  {
    TimerB = (millis());

  }
}

I have question for you.

Can I do something like this.?

 if (millis()  - TimerA >= % 20 (of my specific time ) {

        rec = 4;
      }
      break;
    case 4 :

if (millis() - TimerA  >= % 50 (of my specific time ) {

        rec = 5;
      }

      break;
    case 5 :

Maybe this is wrong way, but ?

Thank you.

Can I do something like this.?

Yes, but you snippet of code is useless to base too much advice on. Do you understand what switch/case does and how ? Do you realise that the % operator does not return a percentage ?

Please post a whole program showing what you want to do.

replace

% 20 (of my specific time )

with

( my_specifc_time * 20 / 100 )