MIDI Clock Drift and Euclidean Pattern Start Offset

Hi everyone,

I'm doing some tests to send MIDI Clock to a Torso S4 (only via SuperDirt MIDI — I wasn’t able to do it using the LINK protocol towards SuperCollider).

I’m using the following:

p "midiclock" $ midicmd "midiClock*96" # s "S4"
p "midictl" $ midicmd "start/4" # s "S4"
p "midictl" $ silence

I didn’t use the stop command (once $ midicmd "stop" # s "S4") as suggested here: MIDI | Tidal Cycles .

During the tests, the clock is stable, but after a few minutes of playback, the Torso S4 slowly drifts out of sync.

I also noticed that Euclidean patterns don’t start from the beginning of the cycle — they don’t start on the first beat.

Just to clarify:

This one starts correctly on the kick:

d1 $ qt $ stack -- K+S
[(s "bd:4 ! ! !" # gain 1.1 # orbit 0),
(s "- sn:5 - sn:2" # dry "1 | 0.9" # room "0.3 | 0.7" # size 0.6 # orbit 1)
]

But this one doesn’t:

d1 $ qt $ stack -- K+S
[(s "bd:4(4,16)" # gain 1.1 # orbit 0),
(s "sn:2(2,16)" # dry "1 | 0.9" # room "0.3 | 0.7" # size 0.6 # orbit 1)
]

Have you ever experienced this issue?

In both cases, resetCycles doesn’t always work — and with the Euclidean pattern, it pretty much never does.

Thanks!
Mauro

Euclidean .. don't start on the first beat

Have you seen the remark on negative timestamps -
https://hackage-content.haskell.org/package/tidal-core-1.10.1/docs/Sound-Tidal-Control.html#v:qtrigger

can you extract a stand-alone pure test case of type Pattern _ (that is, without d1, which has type IO _ and requires a running back-end) Or - is this effect only visible (audible) with a back-end? But qtrigger's type is pure.

NB - Where should an Euclidean pattern start, anyway? I think the current definition is arbitrary (has no musical relevance, no mathematical justification, is only a result of some implementation choices) see https://club.tidalcycles.org/t/what-rotation-does-the-bjorklund-algorithm-produce-and-why-is-it-special/5058

Hi jwaldmann, and thank you for your reply.

I admit that my knowledge of Tidal isn't deep enough to fully understand everything you're saying.

What I can say is that I expected the Euclidean pattern to sound like the draw command shows, e.g.:

draw "x(5,16)"
|x..x..x..x..x...

draw "x(3,16)"
|x....x....x.....

Actually, my main priority is to be able to play with the Torso, so even if I don't end up using Euclidean patterns, that's totally fine.

Anyway, after some testing with $ filterWhen (>= 0), the (just non Euclidean) pattern does sound like I expected :slight_smile:

The shift issue, however, is more serious, because after around 5 minutes of playback, Tidal and Torso get out of sync—sometimes by as much as an eighth note.

I'm still running tests to better understand the issue, since it happens inconsistently.

Thanks again.

Ciao