home/ atoms/ sc-pseq-pattern

Pseq plays items from a list in order for a given number of repetitions

Pseq is the most fundamental sequence pattern. It takes two arguments: a list and a repetitions count (or inf for endless looping). Each call yields the next item in order; after the last, if repeats remain, it wraps to the start. When used inside Pbind, the pattern cycles through values for successive events. Pseq sequences of different lengths in the same Pbind cycle independently. The default repeats value when omitted is 1. Pbind stops when the shortest internal pattern finishes its total repetitions.

Examples

Pbind(
  \degree, Pseq([0, 1, 2, 3, 4, 5, 6, 7], 1),
  \dur, 0.2
).play; // C major scale, once

Assessment

Write a Pbind with two Pseq patterns of different lengths: an 8-note degree sequence and a 3-value duration sequence running inf times. Predict how many notes play before stopping. Verify.

“ly:Pseq.Asthenamemight suggest,thispatterndealswithsequences”
corpus · a-gentle-introduction-to-supercollider-bruno-ruviaro · chunk 3