SuperCollider CLASSES

Pindex

pattern that indexes into an array
Inherits from: Pattern : AbstractFunction : Object

Description

This allows an ArrayedCollection to be accessed within patterns.

Class Methods

*new (listPat, indexPat, repeats: 1)

Arguments:

listPat

the array. Can be a Pattern.

indexPat

the value to retrieve. Can be a Pattern.

repeats

specifies the number of repeats.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

-embedInStream (inval)

Examples

(
SynthDef(\help_pindex, { | out, amp=0.1, freq=440, gate=1 |
    var son = Saw.ar(freq * [0.99, 1, 1.01]).mean;
    son = son * EnvGen.ar(Env.adsr, gate: gate, doneAction:2);
    Out.ar(out, son.dup * amp);
}).add;
)

(
var data = [7, 13, 12, 2, 2, 2, 5];
var indices = [0, 0, 2, 0, 4, 6, 7];
Pbind(
    \instrument, \help_pindex,
    \choice, Prand(indices, inf),
    \degree, Pindex(data, Pkey(\choice), inf),
    \dur, 0.7
).play
)