PIdev:
Filter:
Classes (extension) | Libraries > miSCellaneous > Other patterns | Libraries > miSCellaneous > Idev suite

PIdev : Pattern : AbstractFunction : Object
ExtensionExtension

pattern searching for numbers with integer distance from a source pattern, optionally avoiding repetitions within a span
Source: PIdev.sc
Subclasses: PLIdev

Description

DIdev / PIdef / PLIdev search for numbers with integer distance from a source signal / pattern up to a given deviation. Repetitions within a lookback span are avoided, DIdev / PIdef / PLIdev randomly choose from possible solutions. Intended for search within integer grids (pitches, indices etc.), however applications with non-integer sources are possible, see examples.

NOTE: It's the user's responsibility to pass a combination of deviation and lookback values that allows a possible choice, see examples.
NOTE: In contrast to DIdev, PIdev and PLIdev do *not* need to know maximum deviations (minLoDev, maxHiDev) beforehand. Thus the order of arguments is different (here loDev and hiDev before lookBack).

Class Methods

PIdev.new(pattern, maxLookBack: 3, loDev: -3, hiDev: 3, lookBack, thr: 0.001, length: inf)

Creates a new PIdev object.

Arguments:

pattern

The source value pattern to start search from.

maxLookBack

Integer, the maximum lookback span. Fixed, defaults to 3.

loDev

Determines the current low deviation for the search. Defaults to -3.

hiDev

Determines the current high deviation for the search. Defaults to 3.

lookBack

Determines the current lookback span for avoiding repetitions. Can be modulated but must not exceed maxLookBack. If no value is passed, then maxLookBack is taken.

thr

Threshold for equality comparison. Can be modulated, defaults to 1e-3.

length

Number of repeats. Defaults to inf.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

.embedInStream(inval)

.hiDev

.hiDev = value

.length

.length = value

.loDev

.loDev = value

.lookBack

.lookBack = value

.maxLookBack

.maxLookBack = value

.pattern

.pattern = value

.thr

.thr = value

Examples

 

Ex. 1: Basic usage: random choice within region without repetitions

 

Ex. 2: Variable deviations and lookBack

 

Ex. 3: Moving source signal

 

Ex. 4: Dynamic deviation range and lookBack

 

Ex. 5: Non-integer source

 

Ex. 6: Multichannel expansion

 

Ex. 7: Application to other params: rhythm

 

Ex. 8: Proof of concept