Skip to content

Improved song sync 2.0 now with even more improvement#1558

Draft
polson wants to merge 31 commits into
YARC-Official:devfrom
polson:feature/improved-sync
Draft

Improved song sync 2.0 now with even more improvement#1558
polson wants to merge 31 commits into
YARC-Official:devfrom
polson:feature/improved-sync

Conversation

@polson

@polson polson commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Song sync improvements

This improves song synchronization to be faster and more accurate. Works with a 5000ms buffer without oscillation.

In addition we fix meteronome sync to line up more accurately with the beatlines with a new BassOneShotChannel class. This class uses a DSP to schedule the playback of a pre-loaded oneshot sample (ie metronome sound). It also handles the rescheduling necessary upon time and tempo changes. We also introduce a MetronomeScheduler class that schedules these all at once.

  • Tested on macOS and Windows with multiple buffer sizes and song speeds.
  • Both macOS and Windows give 0 ms audio calibration when playing on a device keyboard, which indicates that measurements are correct on both platforms.
    Linux testing TBD.

Example video with 2000 ms buffer

CleanShot.2026-07-11.at.17.29.42.mp4

Changes

  • Sync correction now runs on the main unity thread. This greatly reduces complexity and prevents deadlock issues. Testing ensures that sync still works correctly even at 5 fps and 1000ms buffer size.
  • Song sync accuracy is now to 1.5 ms with a new algorithm based on a Smith-predictor
  • Song seek and resume also now lands much closer to the target, so only a small tempo adjustment is required to sync up after these events. Sometimes no tempo adjustment is needed.
  • Metronome now runs perfectly in sync with the beatlines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant