Audio Timing Help

So I’m trying to make a mechanic of picking up an object (has sound effect on it) that is in sync with the background music. (think RAYMAN Legends Music Levels) The player is moving at 250 Max speed with 1000 acceleration. Goal is to have the player pick up the placed object and be in time with the background music. I can’t seem to place the object in the same time as the beats in the background music. Its always some milliseconds too slow or fast. I need the sound effect and background music to be in sync every time the player picks up the object on the ground. Any simple solution for this? Been digging at this for 8 hours now lol. Tried a lot of stuff.

Tried manually placing each object/try to listen by ear, count the object position and add the same amount of distance between every other object, and tried using a timer but I cant seem to utilize the time the way I should.

Hopefully enough input can put me in the right direction.

If player’s distance to drummer is less than 10 px, play drum sound
And if you want someone to pop out of ground like that dog type thing, you can keep the make the first frame a little bit longer that syncs with music

Made any progress on this?
I would check how much distance in pixels the player covers at full speed between two beats, and use that distance as basis to lay the objects.
Then I would look for the right starting point, using trial and error, to trigger the music playing at the right time.

Yes! I ended up setting the distances like you suggested. I’m gonna manually place all the notes for each part instead of running a music file. This is the best option to guarantee in sync audio regardless of performance of the game.

Thank you so much!

I have another question. I’m having the player pick up these notes we were talking about. That part is working well but I can’t seem to figure out how to set up a true/false statement for the note pick up. If player misses note pick up then restart the scene. Do you have suggestions for setting this up?

Should it be for missing just one note?
Either way, assuming the player is constantly moving to the right, the note will move to the left of the screen.
Make a offscreen sprite “catcher”, We’ll do two things:

  1. Use “Pin” extension to make sure it’s constantly following the player, but offscreen.
    (I’ve never used that extension - so, the other option is constantly set X position catcher to player.X() - (ScreenWindowWidth() / 2 - catcher.Width())
    ^ This makes the catcher sprite always be just slightly offscreen.

  2. When catcher is colliding with note object, use Change the scene action to load the same scene again. (If your scene name is Scene, use “Scene”)

Hopefully that answers it. Or is it different ?