How to get the beats of a song before playing it?

Hi! (new here) making a rhythm game and because the notes need to start appearing before the song actually begins i need to have a way to start counting beats before playing the song itself. i tried simply having a muted version of the song played in a single instrument and to just start playing the actual song after some beats pass, but it seems as there’s a slight delay when starting new instrument. I’m sure there’s a proper way to do this with multi instrument or other instruments, but i don’t know how. does anyone have a good answer to this?