Bubobubobubobubo/sardine

`LinkClock`: answer to transport messages

Opened this issue · 1 comments

In order to synchronise multiple players, you can make use of the LinkClock that uses the Ableton Link clock API. It has been implemented for quite a while in Sardine but has never been fully integrated. The branch link-start-stop-sync now centralizes the efforts to implement the clock more deeply. There are some low-hanging fruits that would make the life easier for most users:

This should be enough to make Sardine a battle-ready tool. Integration and compliance is easy to test with any Link-enabled product. There is a test plan that details how Link should be implemented to be compliant with other applications:

TEMPO

  • TEMPO-1: Tempo changes should be transmitted between connected apps.
  • TEMPO-2: Opening an app with Link enabled should not change the tempo of an existing Link - session.
  • TEMPO-3: When connected, loading a new document should not change the Link session tempo.
  • TEMPO-4: Tempo range handling.
  • TEMPO-5: Enabling Link does not change app's tempo if there is no Link session to join.

Beat Time

  • BEATTIME-1: Enabling Link does not change app's beat time if there is no Link session to join.
  • BEATTIME-2: App's beat time does not change if another participant joins its session.

Start Stop States

  • STARTSTOPSTATE-1: Listening to start/stop commands from other peers.
  •  STARTSTOPSTATE-2: Sending start/stop commands to other peers.

Audio Engine

  • AUDIOENGINE-1: Correct alignment of app audio with shared session

Update on current efforts:

  • Ableton Link is now well integrated and Sardine reacts to messages like it should 😄
  • The quant mechanism for AsyncRunners is not reliable. Functions start and update whenever they like and not on any precise beat. This is the main problem preventing the release of a new version.
  • Audio / message latency compensation is not implemented. Be sure to put dirt.nudge and midi.nudge to 0 when testing, even if it ends up generating late messages on the SuperCollider side. This can be quite hard to implement and I'm not sure that it will be done. Audio sync will have to be taken care of by the user most likely.

Note that fixing the quant keyword for swim will also be beneficial for the InternalClock.