These are essentially flow of control patterns. Each one takes a source pattern and repeats values from it, or stops the stream early based on a preset constraint.
These patterns allow you to repeat single values, or (in the case of Pn) entire patterns.
connectedpattern is true, Pclutch returns the next value from
connectedis false, the previous pattern value is repeated. It's like a clutch in a car: when engaged, the pattern moves forward; when disconnected, it stays where it is.
repeatstimes: simple repetition. This also works on single values:
Pn(1, 5)outputs the number 1 5 times.
patternare both patterns. Each value from
nis a pattern, each value can be repeated a different number of times.
Instead of prolonging a stream by repetition, these patterns use different methods to stop a stream dynamically. They are especially useful for modularizing pattern construction. One section of your code might be responsible for generating numeric or event patterns. By using constraint patterns, that part of the code doesn't have to know how many events or how long to play. It can just return an infinite pattern, and another part of the code can wrap it in one of these to stop it based on the appropriate condition.
countvalues from the source pattern, then stops. (Pfin has a cousin, Pfinval, that is deprecated.)
Pconst(sum, pattern, tolerance)
Pfindur(dur, pattern, tolerance)
Psync(pattern, quant, maxdur, tolerance)
maxdur(in which case it behaves like Pfindur, adjusting the last event so the total duration matches
maxdur), or the pattern stops early and the last event is rounded up to the next integer multiple of
quant. This is hard to explain; a couple of examples might make it clearer.
Previous: Pattern Guide 060: Filter Patterns