Skip to content

Trigger a pattern from the start

The Tidal Cycles cycles clock is always ticking. Sometimes, you will need to start your pattern from the beginning, in a deterministic way. There are many ways to do so.

nudge

nudge is a function originally implemented to play around with the timing of audio sample playback. You can use it to get a nice swing effect. You can also use it to deal with various timing problems.

You can set a nudge value on individual patterns to get them to shift in time:

d1 $ s "bd*4" # nudge 0.9 -- here I'm setting the nudge for this pattern

If you need to affect all of the patterns, you can also use nudge on every pattern using all:

d1 $ s "bd*4" # nudge 0.9 -- nudge for this pattern
d2 $ fast 2 $ s "~ sn" # nudge 0.4 -- different value
all $ (|+ nudge 0.2) -- adding 0.2 to the nudge param.
-- that would result in # nudge 1.1 for d1 and 0.6 for d2
nudgeAll 0.2 -- alternative shorthand version

qtrigger and trigger

d2 $ sound "bd hh hh hh"
d2 $ qtrigger $ sound "bd hh hh hh"
d2 $ trigger $ sound "bd hh hh hh"

resetCycles

Use resetCycles to… reset the cycle count. This will reset the cycle count as soon as you run it, not at the end of the current cycle:

do
resetCycles
d1 $ s "bd*4"
d2 $ s "~ hh ~ hh*2"