Patterns that generate output based on an input list.
pseq
- Simply yields each element of its input list in order.pser
- Likepseq
, but instead of yielding the whole list N times, yields a total of N outputs.prand
- Yields a random element from its input list.pxrand
- Yields a random element from its input list, never yielding the same output twice in a row.pwrand
- Yields a random element from its input list, based on a list of weights for each element.pwxrand
- Yields a random element from a weighted list, never yielding the same output twice in a row.pshuf
- Shuffles the input list, then yields the elements of the shuffled list in order a specified number of times.pslide
- “Slide” across successive sections of a list, advancing the start point of the sublists by a specified amount between each.pindex
- Get a specified element from the source list by its index.place
- Interlace values from sublists of the input list.ppatlace
- Interlace values from patterns in the input list.pwalk
- Walk across the input list by moving relative to the current position in it.
Patterns that generate numbers according to curve formulae.
pseries
- Each output is the previous element plus a number.pseries*
- Syntax sugar for apseries
whose outputs move over a range linearly over a set number of steps.pgeom
- Each output is the previous element multiplied by a number.pgeom*
- Syntax sugar for apgeom
whose outputs move over a range exponentially over a set number of steps.
Patterns that generate random numbers.
pwhite
- White noise pattern; random numbers evenly distributed within a range.pbrown
- Brownian motion pattern; random numbers within a range, where each number is a maximum amount away from the previous output.pexprand
- Exponentially-distributed random numbers.pgauss
- Gaussian-distributed random numbers.
Patterns whose outputs are the results of math operations on other patterns.
p+
,p-
,p*
,p/
- Basic math patterns.p/=
,p=
,p<=
,p<
,p>=
,p>
- Basic numeric comparisons.peql
- Basic equality test a laeql
.pwrap
- Wrap numeric values within a specified range.prerange
- Remap an input from one range to another range.pdiff
- Get the difference between successive outputs of the source pattern.pdelta
- Get the difference between successive outputs of the source pattern, wrapping negatives within a specified range.
Patterns that repeat or skip outputs from a source pattern.
pr
- Repeats (or skips) each output from its source pattern a specified number of times.pn
- Loops its source pattern a specified number of times.pdurstutter
- Repeats each element from its source pattern a specified number of times, dividing that element (or the duration of it if the element is an event) by that number.pdrop
- Drop the first or last N outputs from a source pattern.
Patterns that generate output by transforming a source pattern.
pclump
- Clump outputs of the source pattern together into lists of N elements.paclump
- Automatically clump the source’s outputs into lists whose length matches the longest list in the current*event*
.pfilter
- Skip elements of a source pattern that a predicate function returns false for.pfilter-out
- Skip elements of a source pattern that a predicate function returns true for.
Patterns that limit the number of, or values of, outputs from a source pattern.
pconst
- Limits the sum of the source pattern not to exceed a specified value.pfin
- Limits the number of outputs yielded by its source pattern.pfindur
- Limits the total duration of the outputs from its source pattern.psync
- Limits the total duration of the outputs from its source pattern, adding a rest to bring the total duration to a specified multiple.
Patterns that yield information about timing, or alter the timing of a source pattern.
pbeat
- Get the current beat of the pattern relative to its start.pbeat*
- Get the current beat of the clock.ptime
- Get the current elapsed time in seconds of the pattern relative to its start.prun
- “Run” a pattern independently, yielding each output for a specified number of beats.pts
- Timestretch a pattern’s total duration to a specified number of beats.
Patterns that generate by referencing the outputs of other patterns.
pk
- Gets the value of a previously-defined key from the enclosing pbind.phistory
- Get previous outputs of a pattern by their index in the pstream.pscratch
- “DJ-like” scratching or scrubbing through the outputs of its source pattern.protate
- Shift a pattern’s outputs forward or backward in the pstream, similar toalexandria:rotate
.ps
- Preserve the pstream state across invocations.prs
- Syntax sugar for(pr (ps ...) ...)
.
Patterns that generate output based on an input function.
pfunc
- Yield the result returned by its input function. Unlikepnary
,pfunc
does not supply arguments to its function.pf
- Syntax sugar forpfunc
so you don’t have to write(lambda () ...)
.pnary
- N-ary function pattern for applying a function to each of its arguments’ outputs.plazy
- Lazily generate a pattern in place of this one by using the result of the input function.pif
- “If” expression. If the source pattern returns a true value, yield the next output from the “then” pattern; otherwise, yield the next output from the “else” pattern.paccum
- Numeric accumulator. Yields the value of applying its input function to a step parameter and the previous output.
Patterns that allow you to write in a “pseudo-language” which may be more suited to specific tasks.
ptrack
- “Tracker-like” way to specify event patterns. Likepbind
but with parameters as columns instead of rows.pt
- Syntax sugar forptrack
so you don’t have to quote or write(list ...)
.pcycles
- TidalCycles-inspired syntax; divide time between the elements of a source list.
Patterns whose functionalities are based on UGens.
pmouse
- Get the mouse position of the display server (GUI).pmousex
- Get the mouse’s x position on screen.pmousey
- Get the mouse’s y position on screen.
Patterns whose outputs are based on music-related formulae or data.
pbjorklund
- Euclidean rhythm generation via the Bjorklund algorithm.psplits
- Parameters to play sections of buffers defined via “split points”. Available in the bdef library.
Patterns that are used to define or debug others.
pbind
- Basic event-stream-defining pattern.pb
- Syntax sugar effectively combining the functionality ofpdef
andpbind
together.pmono
- Likepbind
, but for monophony instead of polyphony.pdef
- Pattern definition. Give a global name to a pattern, which allows it to be changed while it’s playing.ptrace
- Prints the outputs of its source pattern; useful for debugging.pchain
- Chain patterns together by using the first source pattern’s output as the input to the second, etc.pfor
- Use each output of one pattern as input to a full play-through of another.ppar
- Play patterns in parallel so that their outputs appear together in one pstream while preserving timing.pparchain
- Define and play multiple patterns in parallel, each pattern using the previous’s output as its input.ppc
- Syntax sugar for writingpparchain
in the style ofpb
.psym
- Define a sequence of patterns by name to play in succession and/or parallel.pmeta
- Meta-control patterns by applying various transformations to them with apbind
-like syntax.ipstream
- Insertable pstream; a pstream changeable while playing by the insertion of additional pstreams.