Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Refactor Elastique Direct to use SetNextSyncPoint #190

Open
drowaudio opened this issue Jan 25, 2024 · 0 comments
Open

[FR]: Refactor Elastique Direct to use SetNextSyncPoint #190

drowaudio opened this issue Jan 25, 2024 · 0 comments

Comments

@drowaudio
Copy link
Contributor

At the moment, when reset() is called, there is a large processing load to get the first block. This can happen when the transport jumps/loops or the clip loops. Some kind of reset is required to avoid syncing problems.

Pros

It has been suggested that SetNextSyncPoint could be used instead of reset() as this has the capability of not only specifying the stretch/pitch ratio but also a sync point. This in theory means that instead of calling reset, we could call SetNextSyncPoint and discard any fifos, the next supplied input buffer would then produce an output buffer in sync.

Cons

The main problem with this approach is that calls to SetNextSyncPoint have to be 4096 samples apart which is roughly equal to 90ms at 44.1KHz. If we can only adjust with this granularity, timing might drift as we play back blocks at incorrect stretch ratios whilst we wait for a new ratio to be applied.

For further context at 180bpm (3bps, 0.003bpms), a quarter note would last ~83ms so we would only be able to adjust the tempo/stretch factor every 83ms which means we could be playing the wrong tempo for nearly a whole quarter note.
Our internal tempo changes are accurate to 1/4 quarter note.

This also probably means we have to queue up new stretch/pitch ratios and dispatch them after the required num samples have elapsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant