Repeatedly trigger an event with highly accurate timing.

0 favourites
  • 4 posts
  • I discovered Construct 2 quite recently. So far, very intuitive and simple to use—a big thanks to the creators! It seems a great platform for somebody like me who can think logically, but doesn't know any programming language. I'm mostly interested in using Construct 2 to make music apps.

    I'm currently working on a metronome, and while I can get it to function how I like, I'm finding it impossible to make the timing solid. It's always fluctuating. Or, to put it another way, there is always a small margin of error which becomes especially noticeable above 76 bpm, as the beat seems to waver back and forwards with up to 1 bpm difference from beat to beat.

    I think it's to do with the fact that all the timing options have limited accuracy: the "compare time" or "every x seconds" conditions are tied into the FPS (ticks); object timer behaviors, or "every x seconds" or "wait" commands are all limited to about 0.01s accuracy (sometimes worse).

    So, the question is this: if I want to have a metronome beeping steadily and accurately at 61bpm (that's 1 beep every 0.9836), how do I accomplish this in Construct 2? It seems like it's not possible. Or maybe I'm missing something quite basic...!?

  • Construct 2 will try to tie the logic of the game to the VSync I think, which maybe is limiting the actual precision you need, also, the browser may take a little time to actually play the Beat sound when you command it to do so. I do not know if the sound playing is tied to the app framerate (and furthermore I 'm not sure the actual triggers can run between ticks), so the precision needed in your case might not be possible to achieve (I'm not sure of that, hope someone else can confirm or revoke it), also, What is a BPM? (Beat per ..?).

  • BPM = Beats Per Minute

    I'd be interested in this too as I would like to create a dynamic music/sound system... the webaudio API does apparently have access to very accurate timing information which would be necessary for this kind of set up. Whether or not it is implemented in Construct is a different matter... I'm going to hazard a guess that as Aphrodite has mentioned, it is tied to the overall delta time system since there doesn't appear to be any way to access any other timing info. Which is a shame because sound/music is often overlooked and the webaudio API gives a lot of control that could have a lot of potential if we could get at it!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks both of you.

    Having looked at it more today, I just don't think there is a way to access the raw system time. Maybe possible using the SDK, but then that's starting to get over my head, and the appeal of C2 is in avoiding all that text-based coding!

    It's a shame, because it really limits the possibilities for using C2 in music apps.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)