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

Use target latency in all send modes #927

Merged
merged 2 commits into from
Jul 15, 2022

Conversation

Zalastax
Copy link
Collaborator

Enables moving the scheduling of tidal, back and foreward on the Ableton Link timelime.

As requested in #660.

Zalastax added 2 commits July 14, 2022 16:13
Enables moving the scheduling of tidal,
back and foreward on the Ableton Link timelime.
As explained in tidalcycles#660, SuperDirt receives the OSC bundles from SuperCollider immediately and is handed a timestamp.
SuperDirt uses this timestamp to know when to start the sound synthesis.
This timestamp needs to be early on the Link timeline so that the synthesized sound reaches the speakers just in time.
50 milliseconds early appears appropriate, based on experimenting in a Link session with Ableton Live.
@Zalastax Zalastax merged commit c9df210 into tidalcycles:main Jul 15, 2022
@@ -6,7 +6,7 @@ import Sound.Tidal.Context
import System.IO (hSetEncoding, stdout, utf8)
hSetEncoding stdout utf8

tidal <- startTidal (superdirtTarget {oLatency = 0.1, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cVerbose = True, cFrameTimespan = 1/20})
tidal <- startTidal (superdirtTarget {oLatency = 0.05, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cVerbose = True, cFrameTimespan = 1/20})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm late at the party, but why this latency has been lowered? In my setup I have to raise it to 0.2 since it really depend on everyone's setup, and especially for old-computers this value could cause a lot of late messages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure, is your comment based on before or after the change to use Ableton Link for scheduling?

To avoid late messages, cProcessAhead can be adjusted. It's current value 3/10 instructs Tidal to schedule events when they are 300ms away on the Link timeline.

oLatency adjusts how much time SuperDirt needs for sound synthesis. A higher value will start the synthesis earlier. A higher oLatency requires a higher value for cProcessAhead if we want to avoid late messages.

It would be great to have a report from different people to learn what settings they use. That input could help us set better defaults. Since scheduling has changed significantly, I did not trust the old values and thus changed them to fit my setup. My thinking was that it's better to have values that have been tested with the new scheduling than to stick to the old values.

Copy link
Contributor

@ndr-brt ndr-brt Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, didn't have the chance to try the new scheduler...
I always thought (and it always behave in the way...) that the oLatency value is added to the timestamp that's sent to superdirt to trigger the sounds, and when I set it under 0.2 late messages start to appear.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct about the old behaviour @ndr-brt! I hope to make a technical writeup about the new behaviour in early fall as part of the documentation that needs to be added. cProcessAhead achieves the same effect but in a different way, while oLatency is now only useful for alignment on the Link timeline.

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

Successfully merging this pull request may close these issues.

2 participants