QcPenPrinter: no need to allocate QPrintDialog on heap
[supercollider.git] / HelpSource / Classes / WrapIndex.schelp
blobdd89d6b90c5a48af62e88433fd10a1bd2f944585
1 class:: WrapIndex
2 summary:: Index into a table with a signal.
3 related:: Classes/Index, Classes/Shaper
4 categories::  UGens>Buffer
7 Description::
9 The input signal value is truncated to an integer value and used as an
10 index into the table. Out-of-range index values are wrapped cyclically to
11 the valid range.
14 classmethods::
16 method::ar, kr
18 argument::bufnum
20 Index of the buffer.
23 argument::in
25 The input signal.
28 argument::mul
30 Output will be multiplied by this value.
33 argument::add
35 This value will be added to the output.
38 Examples::
40 code::
43 // indexing into a table
44 s = Server.local;
45 t = [ 200, 300, 400, 500, 600, 800 ];
46 b = Buffer(s,t.size,1);
48 // alloc and set the values
49 s.listSendMsg( b.allocMsg( b.setnMsg(0, t) ).postln );
51 SynthDef("help-Index",{ arg out=0,i_bufnum=0;
52         Out.ar(0,
53                 SinOsc.ar(
54                         WrapIndex.kr(
55                                 i_bufnum,
56                                 MouseX.kr(0, t.size * 3)
57                         ),
58                         0,
59                         0.5
60                 )
61         )
62 }).play(s,[\i_bufnum,b.bufnum]);