Resetting Cycle Start?

How do I ensure that a cycle starts from the beginning every time I start it?
I know I saw this in some video but I can't remember where.

Thanks.

You can use resetCycles but I think there are some quirks about it:

do
  resetCycles
  d1 $ s "bd"

Some more information about how to handle resetting the cycle count is available in the documentation for seqP: https://tidalcycles.org/index.php/seqP

3 Likes

Thanks. resetCycles seems to be doing the trick as far as I can tell.
I'm curious to hear more about the quirks. Are there things that might stop me from wanting to use it?

Cheers.

I haven't used it in a while, but as I recall sometimes it would "hiccup" and not start smoothly. It can get off to a weird start sometimes. But, not all the time. :man_shrugging: Your mileage may vary depending on what you are doing!

2 Likes

Okay thanks. I'll see how it goes.

There's also reset:

1 Like

Yes I was puzzling over the difference between reset, trigger and qtrigger.

d1 $ trigger 1 $ sound "clap*4" # speed (rand + 1)

This quantises to the nearest cycle start (the 'sam')

d1 $ qtrigger 1 $ sound "clap*4" # speed (rand + 1)

I'll have to have a proper look, but I'm not sure of the difference between qtrigger and reset
The '1' refers to the 1 in 'd1' by the way

3 Likes

for anyone finding this thread looking for info on reset and qtrigger --

both shift pattern time 0 to the next cycle boundary, i think the difference is that reset also mutes the pattern until the cycle boundary so it starts sounding at pattern time 0. qtrigger doesn't, so you'll hear the pattern content at negative times, from when you execute qtrigger to the next cycle boundary. trigger meanwhile is not quantized so there is nothing to mute, it shifts pattern time 0 to right now.

so for example if you are composing and want to hear your piece from the beginning, you probably want reset. if you are performing a transition you might use qtrigger to include a lead-in/fill before the change. to start a pattern immediately (out of sync with other patterns) you would use trigger. similar to how you can play a sample immediately with once.

4 Likes

resetCycles is currently inaccurate and may often lose an event at the start of the first cycle.

This will be fixed properly at some point but for now a good workaround is to manually adjust the definition of resetCycles so that events aren't missed:

resetCycles = Tempo.changeTempo (sTempoMV tidal) (\t tempo -> tempo {Tempo.atTime = t + 0.1, Tempo.atCycle = 0})

You can increase that 0.1 to a value that works best for you, and put it in your BootTidal.hs to make it permanent.

8 Likes

Is there any way to trigger resetCycles via osc?

I'm working on a recording setup in Ardour where I start the recording and "start" tidal at the same time, meaning that all of the audio and midi recorded will be aligned to the grid.

2 Likes
resetCycles = Tempo.changeTempo (sTempoMV tidal) (\t tempo -> tempo {Tempo.atTime = t + 0.1, Tempo.atCycle = 0})

Evaluating this statement gives me an error:

"Not in scope: ‘Tempo.atCycle’
No module named ‘Tempo’ is imported."

I also tried adding it to the BootTidal.hs and wasn't able to boot Tidal. I'm not sure where I should be adding it.

Hi @palinopsic, resetCycles has been reimplemented in Tidal 1.9. I don't know if the mentioned bug can still happen. If it can, please open a bug report and I'll have a look.

The implementation of resetCycles is now Tidal/BootTidal.hs at c529f7063f111dceaba4eb7db15da74b025d82f3 · tidalcycles/Tidal · GitHub

Hey @Zalastax, as far as I can tell, the first event is always skipped when using resetCycles.
Resetting a pattern like "bd sd cp" will skip the bd event. Is this a bug?

Hi @palinopsic, yes that is a bug in my opinion. The relevant code is here: Tidal/Tempo.hs at c529f7063f111dceaba4eb7db15da74b025d82f3 · tidalcycles/Tidal · GitHub

I can try to look into it but it would be best to get a bug report in Github so it's not forgotten about.

Should be fixed in Fix resetCycles skipping and lateness by Zalastax · Pull Request #966 · tidalcycles/Tidal (github.com).

Thanks for reporting this @palinopsic!