2 summary:: Index into a table with a signal, linear interpolated
3 categories:: UGens>Buffer
4 related:: Classes/Index, Classes/IndexInBetween
7 The input signal value is used as an index into the table, with linear interpolation.
8 Out of range index values are clipped to the valid range.
19 // indexing into a fixed table
24 LocalBuf.newFrom([ 200, 300, 400, 500, 600, 800 ].scramble),
25 LFSaw.kr(2.0).range(0, 7)
38 LocalBuf.newFrom([ 200, 300, 400, 500, 600, 800 ].scramble),
48 // indexing into a changeable table
50 t = [ 200, 300, 400, 500, 600, 800 ];
51 b = Buffer(s, t.size, 1);
53 // alloc and set the values
54 s.listSendMsg( b.allocMsg( b.setnMsg(0, t) ).postln );
56 SynthDef(\help_index, { arg out = 0, i_bufnum = 0;
61 LFSaw.kr(2).range(0, 7)
67 }).play(s, [\i_bufnum, b]);
70 b.setn(*[ 200, 300, 400, 500, 600, 800 ].scramble.postln - 30);
74 SynthDef(\help_index, { arg out = 0, i_bufnum = 0;
79 MouseX.kr(0, BufFrames.ir(i_bufnum))
85 }).play(s, [\i_bufnum, b]);