strudel icon indicating copy to clipboard operation
strudel copied to clipboard

Ableton link integration

Open daslyfe opened this issue 1 year ago • 3 comments

Currently working: - Stop/Start Sync from both directions

  • Changing CPS of the Abelton link clock, although I was unable to figure out how to get the CPS of the "main" clock in Strudel. Comments in code.

needs to be implemented:

  • hooking up phase syncing/ CPS changes in strudel. I left comments in the code where I thought it could be added, I just wasn't sure how to do it. Also somewhat unsure about the implementation extending cyclist. could use some advice here or feel free to just take over the pr.

daslyfe avatar Oct 02 '23 00:10 daslyfe

this is great, tested it with ableton and it works! sometimes the phase is not picked up correctly but a restart fixes it. I am also sometimes not able to start strudel, it just does nothing when i evaluate, but it works with some mashing.

Changing CPS of the Abelton link clock, although I was unable to figure out how to get the CPS of the "main" clock in Strudel. Comments in code.

now setting the cps accordingly.. the clock desync problem is appearing here as well when setting the cps to not so round floats, like .75. .5, 1 and .8 seem to work. this is the root of the problem: https://github.com/tidalcycles/strudel/issues/119#issuecomment-1743644467 this should probably be fixed in a separate PR.

hooking up phase syncing/ CPS changes in strudel.

I've added a setPhase to the clock, but it seems the phase of the payload and the phase of the clock do not really fit together. clock.getPhase() returns the seconds since the playback started, while phase from the payload is always a very small number, often 0. @daslyfe do you know what that phase is relative to?

felixroos avatar Oct 02 '23 19:10 felixroos

hm ok it seems the phase is also desyncing when strudel is open and paused for a bit. only able to sync it again when restarting strudel

felixroos avatar Oct 02 '23 19:10 felixroos

" @daslyfe do you know what that phase is relative to?"

The phase for link represents where the clock is in a single bar at the set tempo (it should count from 0 -4), so I think this can be translated in strudel to be the length of a single cycle. So a phase of 0 should be the start of the cycle, and a phase of 2 should represent the middle of a cycle.

"the phase is also desyncing when strudel is open and paused for a bit. only able to sync it again when restarting strudel"

Yes, I think that is because of the clocks drifting apart I am guessing. The backend sends a message every 30 seconds with the next time the phase should be 0 (or the start of a cycle) so hopefully using that to nudge the clock on a cadence will keep things from drifting too far.

" I am also sometimes not able to start strudel, it just does nothing when i evaluate, but it works with some mashing"

Unless I am misunderstanding the issue, Strudel should start at the beginning of the next phase of the Ableton link clock, so it will vary in time depending on when you press it.

daslyfe avatar Oct 02 '23 20:10 daslyfe