Pattern library reference
Core
View source: core.py
Class | Function |
---|---|
Pattern | Abstract superclass of all pattern generators. |
PConstant | Returns a fixed value. |
PRef | Contains a reference to another pattern, which can be replaced dynamically. |
PFunc | Returns the value generated by a function. |
PArrayIndex | Request a specified index from an array. |
PDict | Construct a pattern from a dict of arrays, or an array of dicts. |
PDictKey | Request a specified key from a dictionary. |
PConcatenate | Concatenate the output of multiple sequences. |
PAbs | Absolute value of input |
PInt | Integer value of input |
PAdd | Add elements of two patterns (shorthand: patternA + patternB) |
PSub | Subtract elements of two patterns (shorthand: patternA - patternB) |
PMul | Multiply elements of two patterns (shorthand: patternA * patternB) |
PDiv | Divide elements of two patterns (shorthand: patternA / patternB) |
PFloorDiv | Integer division (shorthand: patternA // patternB) |
PMod | Modulo elements of two patterns (shorthand: patternA % patternB) |
PPow | One pattern to the power of another (shorthand: patternA ** patternB) |
PLShift | Binary left-shift (shorthand: patternA << patternB) |
PRShift | Binary right-shift (shorthand: patternA << patternB) |
PEqual | Return 1 if a == b, 0 otherwise (shorthand: patternA == patternB) |
PGreaterThanOrEqual | Return 1 if a != b, 0 otherwise (shorthand: patternA != patternB) |
PGreaterThan | Return 1 if a > b, 0 otherwise (shorthand: patternA > patternB) |
PGreaterThanOrEqual | Return 1 if a >= b, 0 otherwise (shorthand: patternA >= patternB) |
PLessThan | Return 1 if a < b, 0 otherwise (shorthand: patternA < patternB) |
PLessThanOrEqual | Return 1 if a <= b, 0 otherwise (shorthand: patternA <= patternB) |
Scalar
View source: scalar.py
Class | Function |
---|---|
PChanged | Outputs a 1 if the value of a pattern has changed. |
PDiff | Outputs the difference between the current and previous values of an input pattern |
PSkipIf | If skip is false, returns input ; otherwise, returns None. |
PNormalise | Adaptively normalise input to [0..1] over a linear scale. |
PMap | Apply an arbitrary function to an input pattern. |
PMapEnumerated | Apply arbitrary function to input, passing a counter. |
PLinLin | Map input from linear range [a,b] to linear range [c,d]. |
PLinExp | Map input from linear range [a,b] to exponential range [c,d]. |
PRound | Round input to N decimal places. |
PScalar | Reduce tuples and lists into single scalar values, |
PWrap | Wrap input note values within |
PIndexOf | Find index of items from pattern in |
Sequence
View source: sequence.py
Class | Function |
---|---|
PSeries | Arithmetic series, beginning at start , increment by step |
PRange | Similar to PSeries, but specify a max/step value. |
PGeom | Geometric series, beginning at start , multiplied by step |
PImpulse | Outputs a 1 every |
PLoop | Repeats a finite pattern for n repeats. |
PPingPong | Ping-pong input pattern back and forth N times. |
PCreep | Loop length -note segment, progressing creep notes after repeats repeats. |
PStutter | Play each note of pattern count times. |
PSubsequence | Returns a finite subsequence of an input pattern. |
PReverse | Reverses a finite sequence. |
PReset | Resets pattern whenever trigger is true |
PCounter | Increments a counter by 1 for each zero-crossing in trigger . |
PCollapse | Skip over any rests in input |
PNoRepeats | Skip over repeated values in input |
PPad | Pad pattern with rests until it reaches length length . |
PPadToMultiple | Pad pattern with rests until its length is divisible by multiple . |
PArpeggiator | Arpeggiator. |
PEuclidean | Generate Euclidean rhythms. |
PPermut | Generate every permutation of count input items. |
PPatternGeneratorAction | Each time its pattern is exhausted, request a new pattern by calling |
PSequenceAction | Iterate over an array, perform a function, and repeat. |
Chance
View source: chance.py
Class | Function |
---|---|
PWhite | White noise between min and max . |
PBrown | Brownian noise. |
PCoin | Coin toss, returning either 0 or 1 given some probability . |
PWalk | Random walk around list. |
PChoice | Pick a random element from values , weighted by optional weights . |
PSample | Pick multiple random elements from values , weighted by optional weights , |
PShuffle | Shuffled list. |
PShuffleInput | Every n steps, take n values from pattern and reorder. |
PSkip | Skip events with some probability, 1 - |
PFlipFlop | flip a binary bit with some probability. |
PSwitchOne | Capture length input values; loop, repeatedly switching two adjacent values. |
Tonal
View source: tonal.py
Class | Function |
---|---|
PDegree | Map scale index |
PFilterByKey | Filter notes based on their presence in |
PNearestNoteInKey | Return the nearest note in |
PMidiNoteToFrequency | Map MIDI note to frequency value. |
Static
View source: static.py
Class | Function |
---|---|
PGlobals | Static global value identified by a string. |
PCurrentTime | Returns the position (in beats) of the current timeline. |
Fade
View source: fade.py
Class | Function |
---|---|
PFadeNotewise | Fade a pattern in/out by introducing notes at a gradual rate. |
PFadeNotewiseRandom | Fade a pattern in/out by gradually introducing random notes. |
Markov
View source: markov.py
Class | Function |
---|---|
PMarkov | First-order Markov chain generator. |
Lsystem
View source: lsystem.py
Class | Function |
---|---|
PLSystem | integer sequence derived from Lindenmayer systems |
Warp
View source: warp.py
Class | Function |
---|---|
PWInterpolate | Requests a new target warp value from pattern every length beats |
PWSine | Sinosoidal warp, period length beats, amplitude +/- |
PWRallantando | Exponential deceleration to length beats. |