Inconsistent Timer Events

I just got the Pro version of the SDK and am testing out the API features. My first experiment is with the timer delays. In particular, timer.performWithDelay for event sounds.

I assigned a string sequence of say “----*----*----*----*–*--*----*----*” and got the code to assign a multiple of 100ms per character and to assign a delay to play a sound when the ‘*’ is found. In this instance the delays will be 500ms 1000ms 1500ms and so on. So the simulator should be playing something along the lines of clap clap clap clapclapclap clap clap.

But the rhythm came out unsynchronised. Did a little bit of testing and found that the timer delays are highly inconsistent with errors of up to 25ms on average and in the worst case scenario 300ms.

Does this mean that the Corona SDK is not suitable for creating rhythm games or is there some ingenious way around this that I have yet to find out? [import]uid: 108204 topic_id: 18811 reply_id: 318811[/import]

I think the timers themselves are inconsistent, not just the delays.

I’ve never seen a disparity of 300ms, but I’ve definitely had inconsistencies at the lower half of your range using a repeating 1 second timer. [import]uid: 40137 topic_id: 18811 reply_id: 72434[/import]

Hmmm I think I’ve just solved the timing problems. Instead of loop triggering runtime events with enterFrame for loops, I created a while loop that directly uses the time from system.getTimer().

Guess this was a noobie inexperience issue. For a while I thought Corona was restricted to frame triggers for loops. Turned out better than I expected. [import]uid: 108204 topic_id: 18811 reply_id: 72467[/import]