DIdev:
Filter:
miSCellaneous_lib/Classes (extension) | Libraries > miSCellaneous > Idev suite

DIdev
ExtensionExtension

pseudo drate ugen, searches for numbers with integer distance from a source signal, optionally avoiding repetitions within a span

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: DIdev needs at least a SC version >= 3.7.0 for proper working.
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 PIdev and PLIdev, DIdev needs to know maximum deviations (minLoDev, maxHiDev) beforehand. Together with maxLookBack they determine multichannel sizes, so a relatively high number of ugens might be involved.

Class Methods

.new

Creates a new DIdev object.

Arguments:

in

The source signal, integer distances are calculated from the value of this signal with each trigger. Can be demand rate or other ugen.

maxLookBack

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

minLoDev

Integer, the minimum low deviation (must not be exceeded by any loDev value). Should be negative, cannot be modulated, defaults to -3.

maxHiDev

Integer, the maximum high deviation (must not be exceeded by any hiDev value). Should be positive, cannot be modulated, defaults to 3.

lookBack

Determines the current lookback span for avoiding repetitions. Can be modulated (demand rate or other ugen, no ar) but must not exceed maxLookBack. If no value is passed, then maxLookBack is taken.

loDev

Determines the current low deviation for the search. Can be modulated (demand rate or other ugen) but must not exceed minLoDev. If not specified, them minLoDev is taken.

hiDev

Determines the current high deviation for the search. Can be modulated (demand rate or other ugen) but must not exceed maxHiDev. If not specified, then maxHiDev is taken.

thr

Threshold for equality comparison. Can be modulated (demand rate or other ugen). Defaults to 1e-3.

length

Number of repeats. Defaults to inf.

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

 

Ex. 9: Switching signals with DXMix