rjarn / Boulder

An almost functional guitar tab viewer using Godot. Works with XML guitar tab files in combination with the corresponding song's audio file.
1 stars 2 forks source link

Fix latency/lag that desyncs the notes from the music. #2

Open rjarn opened 2 years ago

rjarn commented 2 years ago

In the game, the note needs to be in sync with the song that is playing. At the beginning of the song, the notes are decently in sync (probably not perfectly in sync). As time passes in the song, the notes get more and more out of sync. My attempts to fix it are located in the _process method, the yield block of code in the test_song method, and the yield block in the displayChords method. While it is the closest I have gotten it to syncing up the notes with the music, it is still nowhere near as synced up as I would like it to be.

rjarn commented 1 year ago

The "attempted" fix behaves differently on the HTML5 version of the game, as opposed to the default desktop version. On the desktop version, the fix normalizes the fluctuation of delay for each note (but it still isn't remotely close to how accurate it needs to be), but on the HTML5 function, it appears as if that normalization doesn't occur at all. Needs testing if this is in the same ballpark as the way to fix the delay problem.

rjarn commented 1 year ago

Below are URLs to godotengine issues that are possibly relevant to this issue: https://github.com/godotengine/godot/issues/49403 https://github.com/godotengine/godot/issues/38215 https://github.com/godotengine/godot/pull/38280