2 summary:: Index into a table with a signal
3 related:: Classes/WrapIndex, Classes/Shaper
4 categories:: UGens>Buffer
7 Index into a table with a signal.
8 The input signal value is truncated to an integer value and used as an
9 index into the table. Out-of-range index values are clipped to the valid
23 Output will be multiplied by this value.
26 This value will be added to the output.
31 // indexing into a fixed table
36 LocalBuf.newFrom([ 200, 300, 400, 500, 600, 800 ]),
37 LFSaw.kr(2.0).range(0, 7)
50 LocalBuf.newFrom([ 200, 300, 400, 500, 600, 800 ]),
60 // indexing into a changeable table
62 t = [ 200, 300, 400, 500, 600, 800 ];
63 b = Buffer(s, t.size, 1);
65 // alloc and set the values
66 s.listSendMsg( b.allocMsg( b.setnMsg(0, t) ).postln );
68 SynthDef(\help_Index, { arg out = 0, i_bufnum = 0;
73 LFSaw.kr(2).range(0, 7)
79 }).play(s, [\i_bufnum, b]);
82 b.setn(*[ 200, 300, 400, 500, 600, 800 ].scramble.postln - 30);
86 SynthDef(\help_Index, { arg out=0,i_bufnum=0;
91 MouseX.kr(0, BufFrames.ir(i_bufnum))
97 }).play(s, [\i_bufnum, b]);