Wrapping array indexes with wrapAt lets SC sequences cycle through parameter arrays of different lengths
In SuperCollider, Array.wrapAt(index) returns the element at index mod array size, wrapping around endlessly. This allows multiple arrays of different lengths to cycle independently when driven by the same counter — creating polyrhythmic or evolving texture through simple index arithmetic. The Ch 1 SimpleBlip Task example uses wrapAt to cycle through pitch, tone, articulation, and amplitude sequences of different lengths from a single counter variable, producing a shifting texture from minimal data.
Examples
Task({ inf.do({ |counter| Synth(“SimpleBlip”, [ \midi, [60, 61, 62, 63].wrapAt(counter), \tone, [1, 2, 3, 4, 5].wrapAt(counter), \art, [0.1, 0.2, 0.3, 0.4].wrapAt(counter) ]); 0.125.wait; }) }).start
Assessment
Write a Task with three arrays of lengths 3, 5, and 7 cycling with wrapAt. Calculate when all three arrays return to their starting index simultaneously. Describe this as a rhythmic cycle length.