2 summary:: pattern that indexes into an array
3 related:: Classes/Pswitch
4 categories:: Streams-Patterns-Events>Patterns>List>Indexing
8 This allows an link::Classes/ArrayedCollection:: to be accessed within patterns.
15 is the array and strong::index:: the value to retrieve - both of these arguments can themselves be link::Classes/Pattern::s.
18 specifies the number of repeats.
24 SynthDef(\help_pindex, { | out, amp=0.1, freq=440, gate=1 |
25 var son = Saw.ar(freq * [0.99, 1, 1.01]).mean;
26 son = son * EnvGen.ar(Env.adsr, gate: gate, doneAction:2);
27 Out.ar(out, son.dup * amp);
32 var data = [7, 13, 12, 2, 2, 2, 5];
33 var indices = [0, 0, 2, 0, 4, 6, 7];
35 \instrument, \help_pindex,
36 \choice, Prand(indices, inf),
37 \degree, Pindex(data, Pkey(\choice), inf),