#N canvas 752 166 723 557 12;
#X text 118 198 index;
#X floatatom 70 199 6 1 8 0 - - - 0;
#X floatatom 70 304 6 0 0 0 - - - 0;
#X text 219 263 creation argument;
#X text 221 279 gives array name;
#X text 195 231 change array name;
#X text 479 516 updated for Pd version 0.43;
#X obj 42 515 tabwrite~;
#X obj 246 515 tabwrite;
#X obj 311 515 tabsend~;
#X obj 376 515 tabreceive~;
#X obj 113 515 tabplay~;
#X obj 181 515 tabread;
#X text 45 58 The tabread4 object reads values from an array ("table")
according to an index \, applying four-point polynomial interpolation.
Indices should range from 1 to (size-2) so that the 4-point interpolation
is meaningful. You can shift-drag the number box to see the effect
of interpolation. Indices outside of the range are replaced by the
nearest index in range (from 1 to 8 in this example)., f 80;
#X obj 419 435 ../2.control.examples/15.array;
#X obj 419 458 ../2.control.examples/16.more.arrays;
#X text 40 439 Check also the "array" examples from the Pd tutorial
by clicking and opening the files to the right ====>, f 52;
#X text 41 488 See also these objects:;
#X msg 80 231 set tabread4-ex;
#X obj 70 271 tabread4 tabread4-ex;
#X text 121 306 output = tabread4-ex[index];
#N canvas 0 0 450 300 (subpatch) 0;
#X array tabread4-ex 10 float 3;
#A 0 8 4 2 8 5 6 1 8 4 2;
#X coords 0 10 10 0 250 200 1 0 0;
#X restore 395 183 graph;
#N canvas 117 649 401 220 init-table 0;
#X obj 35 42 loadbang;
#X msg 35 74 \; tabread4-ex resize 10 \; tabread4-ex bounds 0 10 10
0 \; tabread4-ex xlabel -0.2 0 1 2 3 4 5 6 7 8 9 \; tabread4-ex ylabel
-0.3 0 1 2 3 4 5 6 7 8 9 10 \; tabread4-ex 0 8 4 2 8 5 6 1 8 4 2;
#X connect 0 0 1 0;
#X restore 548 159 pd init-table;
#X obj 73 171 hsl 128 15 1 8 0 0 empty empty empty -2 -8 0 10 #fcfcfc
#000000 #000000 0 1;
#N canvas 792 534 593 399 Dealing_with_"\$0" 0;
#X text 36 33 '\$0' - the patch ID number used to force locality in
Pd - is widely used in send/receive names as well as array names. This
is specially useful in abstractions so each copy has local names instead
of global., f 70;
#X text 462 275 <= array with local name, f 13;
#X obj 221 291 f \$0;
#X msg 121 210 set \$1;
#X obj 121 184 symbol \$0-x;
#X obj 121 161 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X text 227 197 You can also load '\$0' in a float object and send
it to a message that works like a send to send messages to an array.
, f 40;
#X text 140 158 click to set name;
#X floatatom 67 188 6 1 8 0 - - - 0;
#X obj 311 276 array define \$0-x 10;
#X floatatom 67 305 6 0 0 0 - - - 0;
#X obj 67 251 tabread4;
#X msg 221 320 \; \$1-x 0 1 0 -1 0 1 0 -1 1 0 -1;
#X obj 221 264 loadbang;
#X text 36 86 You can use "\$0" in an array name and if you need to
set the array name you can load it in a symbol object \, since "\$0"
doesn't work in messages., f 70;
#X connect 2 0 12 0;
#X connect 3 0 11 0;
#X connect 4 0 3 0;
#X connect 5 0 4 0;
#X connect 8 0 11 0;
#X connect 11 0 10 0;
#X connect 13 0 2 0;
#X restore 202 374 pd Dealing_with_"\$0";
#X text 40 365 open subpatch to see how to deal with '\$0', f 21;
#X obj 85 19 tabread4;
#X text 158 19 - 4-point-interpolating table lookup;
#X connect 1 0 19 0;
#X connect 18 0 19 0;
#X connect 19 0 2 0;
#X connect 23 0 1 0;
