Multiple led sequence over time

I was wandering if I can change the variable 'interval' to be different values in different frames/lines

for example between frame/line 1 to 10 to have an interval of 500 milliseconds and between lines 11 - 22 to have an interval of 1000 milliseconds , then between lines 100 - 150 to have a interval of 250 milliseconds.

Can I do so?
I guess I need to count some how the line I'm in and if the count is passed a specific line then change the interval to a different number.. possible?
edit:
something like that:

#endif
    actualPattern++;                       // switch to next pattern for the next iteration
    if (actualPattern >= totalNoPattern) 
      actualPattern = 0;                  // wrap around
     if (actualPattern > 10 && actualPattern < 20)
     {
      interval = 200;
     }
    previousMillis = millis();
  }
}

edit: I just needed to change the interval to be only int without a const and it seems to work fine!