#N canvas 509 36 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 93 431 tabwrite~;
#X obj 291 432 tabwrite;
#X obj 94 460 tabsend~;
#X obj 159 460 tabreceive~;
#X obj 164 431 tabplay~;
#X obj 232 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 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 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 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 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 connect 1 0 11 0;
#X connect 2 0 10 0;
#X connect 3 0 2 0;
#X connect 4 0 3 0;
#X connect 7 0 10 0;
#X connect 10 0 9 0;
#X connect 12 0 1 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 250 460 pd array-examples;
#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 90;
#X connect 1 0 14 0;
#X connect 13 0 14 0;
#X connect 14 0 2 0;
#X connect 18 0 1 0;
