Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Use target latency in all send modes#927

Merged
Zalastax merged 2 commits intotidalcycles:mainfrom
Zalastax:link-with-latency
Jul 15, 2022
Merged

Use target latency in all send modes#927
Zalastax merged 2 commits intotidalcycles:mainfrom
Zalastax:link-with-latency

Conversation

@Zalastax
Copy link
Copy Markdown
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
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants