PSPdiv:
Filter:
miSCellaneous_lib/Classes (extension) | Libraries > miSCellaneous > Other patterns

PSPdiv
ExtensionExtension

dynamic multi-layer pulse divider

Description

PSPdiv controls the timing of one or several layers of event patterns by a single pulse pattern. In every layer single pulse durations or integer multiples ('division bases') of pulse durations can be divided by Integers or proportionally. For every layer the event pattern data can be given as event pattern or a function, which is generating an event pattern for every divisional operation. Division bases and divisions as well as the pulse itself can be controlled by patterns.

PSPdiv is built on Pspawner and therefore allows sequential or parallel spawning: the type of embedding can be sequenced by a pattern for every divisional operation. So a single layer alone can produce a number of overlapping sequences.

Time division in space notation scheme with two layers and embedding of sequential type:

A sequence of regular or irregular pulses is given as pattern of floats, these durations are marked as proportional spaces in the graphic. The sequence of divBases collects groups of pulses and divides them according to the sequence of divs. The resulting durations of each layer are again marked by proportional spacing, common entry points of layers are marked by emphasized vertical lines.

Special thanks to Ron Kuivila for developing Pspawner, it's such a versatile class !

Class Methods

.new

Creates a new PSPdiv object.

Arguments:

pulse

Duration or pattern of durations, given as beats. Defaults to 1.

evPat

An event pattern, a Function generating event patterns or: a SequenceableCollection thereof. If an event pattern is given, the durations of the current division, calculated from current values of pulse, div and divBase, are inserted with the 'dur' key. If a Function is given, it will be passed 4 arguments:

  • an array of durations of the current division, based on the following arguments
  • the current division number div
  • the current division base number divBase
  • the current division type divType ('seq' or 'par')

The Function should return the event pattern to be scheduled for this division. The typical application would be using the array of durations in a Pseq with repeats = 1 as 'dur' value, though you are free to let it return any kind of event pattern. Layers are slightly shifted, so that the event from a pattern of lower index is calculated before an event from a pattern of higher index, if events are scheduled to happen at the same time.

div

Integer or array of array of numbers, determining a division of divBase * pulse beats or a pattern returning such or: a SequenceableCollection thereof. Defaults to 1. A single array of numbers is interpreted as indicator for several layers (see note below), hence the doubled array is necessary for a proportional division.

divBase

Integer determining the number of multiples of pulse to be used as base of division or a pattern returning such or: a SequenceableCollection thereof. Defaults to 1.

divType

Symbol 'seq' or 'par' or or a pattern returning such or: a SequenceableCollection thereof. Defaults to 'seq'. Determines the type of embedding according to Pspawner's convention.

NOTE: If one of the arguments evPat, div, divBase and divType is passed as SequenceableCollection of size > 1, a multitude of layers is assumed and the other args are interpreted accordingly. To avoid ambiguities only one size > 1 is allowed at maximum amongst these args (but more than one of them can be a SequenceableCollection of this size). Consequently a proportional div arg for one layer must be passed in double brackets.

Examples

 

Ex. 1: Basic functionality with one layer

 

Ex. 2: Parallel embedding with one layer

SynthDef from Ex.1

 

Ex. 3: Ornamenting a line with a second layer

SynthDef from Ex.1

 

Ex. 4: Polyrhythmics of several layers

SynthDef from Ex.1

 

Ex. 5: Granulation, control of many layers

SynthDef from Ex.1