Ok, I didn't understand that ^^ Let me explain the algorithm then :
0/ Variables
CurrentIndex. Initial value : 0. Stores the current index in the array (see below)
1/ Initialization
This phase, triggered by the start of layout, fills the array and set the variable to 0. It starts the song. Then, it calls the function "prepareDisplay" in phase 2
2/ Arrow generation cycle
This phase is made of 2 functions :
- prepareDisplay. This function is called with no parameters. It takes the current time of the song, takes the time of the current arrow to display, and waits for the difference, then calls "doDisplay".
Example, at the start, CurrentIndex = 0. Time of the song = 0. Time of the arrows at the currentIndex (0) of the array is 1,3s. This function will wait 1,3-0 = 1,3s. Then, it will call "doDisplay".
- doDisplay. This function is called with no parameters. It will take the arrow string ("LT" or anything) at the CurrentIndex in the array, analyse and use it to display new arrows, add 1 to currentIndex, and call "prepareDisplay" again.
This cycle will make the function prepareDisplay to be called after every time we display the arrows, to wait for the correct next time to work. doDisplay will just do the work, and call again prepareDisplay.
You will have to add a detection of last arrows of course (end of the array).
I hope this is more clear. If not, tell me what you don't get ^^
Btw, this is not really experience with C2, it's mostly how to structure an algorithm. You would do almost the same thing in other languages.