Recommendations to sync music (Piano tiles)

0 favourites
  • 2 posts
From the Asset Store
40 Seamless textures for tile backgrounds. High resolution 1024x1024!
  • Hi everyone!

    I started a project to recreate piano tiles but I've been having a hard time with the timing and sync.

    Using "Every X seconds" doesn't sync correctly and eventually the music (audio file) starts to lose the synchronization.

    As a first solution, I've started using the "Wallclocktime" and compare it within itself.

    This is what I have for sync so far:

    [Variables]

    ClockTimeRec = 0 - Number variable used to temporarily store wallclocktime

    TickBPM = 0.5 - Number variable for beats (currently 0.5 for 120bpm whic is 60(secs)/120(beats))

    On start of layout - Set ClockTimeRec to wallclocktime

    Then I compared it back with wallclocktime:

    [ClockTimeRec <= (wallclocktime - TickBPM)] - Trigger my event and set ClockTimeRec to wallclocktime

    After this it will wait the amount of time on TickBPM and trigger again

    This solution is working so much better but I feel like there can be a mayor improvement to this method, I'll appreciate any help to improve this and anything else in general that might help me with this rythm game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Update01:

    I've uploaded a synced version; cbucher.itch.io/construct3-rythmtest01

    After a moment, the synchronization seems to be great.

    However, I am getting some very specific lag spikes after a while causing some notes to overlap.

    1. What could be causing them?

    2. Should I avoid constantly using wallclocktime?

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