#N canvas 366 43 721 493 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 445 updated for Pd version 0.43;
#X obj 289 432 tabwrite~;
#X obj 151 432 tabwrite;
#X obj 94 460 tabsend~;
#X obj 159 460 tabreceive~;
#X obj 360 432 tabplay~;
#X obj 92 431 tabread;
#X msg 80 231 set tabread4-ex;
#X obj 70 271 tabread4 tabread4-ex;
#X text 121 306 output = tabread4-ex[index];
#N canvas 781 205 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 575 141 pd init-table;
#X obj 73 169 hsl 162 19 1 8 0 0 empty empty empty -2 -8 0 10 #dfdfdf #000000 #000000 0 1;
#N canvas 681 295 593 399 Dealing_with_"\$0" 0;
#X obj 221 291 f \$0;
#X msg 121 210 set \$1;
#X obj 121 184 symbol \$0-x;
#X obj 121 158 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #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 146 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 text 462 275 <- array with local name, f 13;
#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 especially useful in abstractions so each copy has local names instead of global., f 70;
#X connect 0 0 10 0;
#X connect 1 0 9 0;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 6 0 9 0;
#X connect 9 0 8 0;
#X connect 11 0 0 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 45 16 tabread4;
#X text 118 16 - 4-point-interpolating table lookup;
#N canvas 750 87 581 254 reference 0;
#X obj 18 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 18 131 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 18 176 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0;
#X obj 17 213 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X text 123 101 set <symbol> -;
#X text 172 66 float -;
#X text 228 101 set the table name., f 42;
#X text 172 144 float -;
#X text 228 144 value of index input.;
#X obj 55 18 tabread4;
#X text 128 18 - 4-point-interpolating table lookup.;
#X text 228 66 sets table index and output its value with interpoation., f 42;
#X text 136 185 1) symbol - sets table name with the sample.;
#X restore 521 16 pd reference;
#X text 619 15 <= click;
#X obj 8 50 cnv 1 700 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 8 415 cnv 1 700 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 19 446 See also:;
#N canvas 643 412 384 186 array-examples 0;
#N canvas 491 316 457 285 open 0;
#X obj 120 23 inlet;
#X obj 173 121 pdcontrol;
#X msg 173 94 dir;
#X obj 120 181 pack s s;
#X obj 173 64 loadbang;
#X msg 120 212 \; pd open \$1 \$2;
#X obj 173 151 makefilename %s/../2.control.examples;
#X connect 0 0 3 0;
#X connect 1 0 6 0;
#X connect 2 0 1 0;
#X connect 3 0 5 0;
#X connect 4 0 2 0;
#X connect 6 0 3 1;
#X restore 52 131 pd open;
#X msg 52 76 15.array.pd;
#X msg 62 102 16.more.arrays.pd;
#X text 144 77 <-- click to open examples.;
#X text 47 22 See also and the "array" examples from the section 2 of Pd's tutorial:, f 39;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X restore 298 460 pd array-examples;
#X text 33 61 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 90;
#X obj 217 431 tabread4~;
#X obj 248 460 array;
#X obj 423 166 cnv 19 248 198 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array tabread4-ex 10 float 2;
#X coords 0 10 10 0 250 200 1 0 0;
#X restore 422 165 graph;
#X connect 1 0 14 0;
#X connect 13 0 14 0;
#X connect 14 0 2 0;
#X connect 17 0 1 0;
