home/ atoms/ tidal-iter-shift

iter n rotates a pattern's starting point forward by one subdivision each cycle

iter n p divides pattern p into n equal subdivisions and shifts its starting point forward by one subdivision on each successive cycle, wrapping back after n cycles. Over n cycles the full pattern is heard, but entering from a different phase each cycle: on a four-step pattern, iter 4 plays it normally on cycle 1, starting from the second step on cycle 2, the third on cycle 3, the fourth on cycle 4, then repeats. iter' n does the same rotation backward. This is the main ‘rotation in time’ idiom — a low-cost way to add slow, predictable variation and a sense of development to a static loop without rewriting it, and it combines readily with other transforms. It is specifically a rotation of the start point, not a reversal or a speed change.

Examples

d1 $ iter 4 $ sound "arpy arpy:1 arpy:2 arpy:3"
-- cycle 1: arpy arpy:1 arpy:2 arpy:3
-- cycle 2: arpy:1 arpy:2 arpy:3 arpy ...
d1 $ iter' 4 $ sound "bd hh sn cp"   -- same, rotating backward

Strudel: sound("metal(3,8)").hurry("<1 1 2 4>").iter("4") — the pattern starts from a different quarter each cycle over 4 cycles.

Assessment

Apply iter 4 to a four-step pattern and write out the starting sample for each of the first four cycles. How many cycles until it repeats with iter 3 on a four-step pattern? How does iter' differ from iter?

“referenceText "iter" = "divides a pattern into a given number of subdivisions, plays the subdivision”
corpus · estuary-collaborative-browser-live-coding-platform-networked · chunk 11
“`iter` cycles through the pattern starting at different points, it’s great for adding variety over time”
corpus · music-code-strudel-worksheet-lucy-cheesman-peckham-digital · chunk 2
“`iter` starts the pattern at a different point each cycle, shifting it the given number of times until it gets back to where it started”
corpus · tidalcycles-workshop-hands-on-beginner-course · chunk 5