#N canvas 375 23 813 491 12;
#X obj 31 347 snapshot~;
#X obj 31 149 sig~;
#X floatatom 31 123 6 0 10 0 - - - 0;
#X floatatom 30 372 6 0 0 0 - - - 0;
#X text 164 188 "set" message permits you to switch between arrays, f 25;
#X text 176 239 creation argument initializes array name, f 24;
#X obj 171 428 tabwrite~;
#X obj 306 428 tabread;
#X obj 100 456 tabwrite;
#X obj 165 456 tabsend~;
#X obj 230 456 tabreceive~;
#X obj 242 428 tabplay~;
#X obj 37 16 tabread~;
#X text 88 123 incoming signal is index. Indices should range from 0 to (size-1)., f 34;
#X obj 99 428 tabread4~;
#X obj 364 428 tabread4;
#X text 24 443 see also:;
#N canvas 0 22 450 300 (subpatch) 0;
#X array tabread-ex 10 float 2;
#X coords 0 5.2 10 -0.2 300 150 1 0 0;
#X restore 465 147 graph;
#X msg 52 193 set tabread-ex;
#X obj 31 244 tabread~ tabread-ex;
#N canvas 843 85 401 220 init-table 0;
#X obj 35 42 loadbang;
#X msg 35 72 \; tabread-ex resize 10 \; tabread-ex bounds 0 5.2 10 -0.2 \; tabread-ex xlabel -0.4 0 1 2 3 4 5 6 7 8 9 \; tabread-ex ylabel -0.3 0 1 2 3 4 5 \; tabread-ex 0 1 4 2 0 4 1 3 4 2 5;
#X connect 0 0 1 0;
#X restore 670 123 pd init-table;
#X text 116 16 - non-interpolating table lookup for signals;
#N canvas 711 190 593 412 Dealing_with_"\$0" 0;
#X obj 221 291 f \$0;
#X msg 118 210 set \$1;
#X obj 118 184 symbol \$0-x;
#X obj 118 151 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 140 151 click to set name;
#X floatatom 67 179 4 0 9 0 - - - 0;
#X obj 311 276 array define \$0-x 10;
#X msg 221 320 \; \$1-x 0 1 0 -1 0 1 0 -1 0 1 0;
#X obj 221 265 loadbang;
#X obj 67 251 tabread~;
#X obj 67 344 snapshot~;
#X obj 86 316 metro 200;
#X floatatom 66 369 6 0 0 0 - - - 0;
#X obj 86 288 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 8 0;
#X connect 1 0 10 0;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 6 0 10 0;
#X connect 9 0 0 0;
#X connect 10 0 11 0;
#X connect 11 0 13 0;
#X connect 12 0 11 0;
#X connect 14 0 12 0;
#X restore 619 366 pd Dealing_with_"\$0";
#X text 613 332 open subpatch to see how to deal with '\$0', f 22;
#N canvas 698 164 581 232 reference 0;
#X obj 18 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 18 118 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 18 163 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0;
#X obj 17 200 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 42 16 tabread~;
#X text 115 16 - non-interpolating table lookup for signals.;
#X text 145 66 signal -;
#X text 208 66 sets index for table(s).;
#X text 117 86 set <list> -;
#X text 208 86 set the table names., f 24;
#X text 124 131 signal(s) -;
#X text 138 172 1) list - sets table names to read from.;
#X text 208 131 value(s) of index input from given table(s).;
#X restore 611 18 pd reference;
#X text 709 18 <= click;
#X obj 8 52 cnv 1 800 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 8 412 cnv 1 800 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#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 317 456 pd array-examples;
#X msg 224 334 \; pd dsp \$1;
#X obj 224 299 set-dsp-tgl;
#X text 255 303 DSP on/off;
#N canvas 685 183 564 407 multichannel 0;
#X obj 68 257 snake~ out, f 12;
#X obj 69 138 sig~;
#X floatatom 69 112 6 0 10 0 - - - 0;
#N canvas 0 22 450 300 (subpatch) 0;
#X array array77 10 float 3;
#A 0 2.824 1.366 3.094 1.636 0.610006 4.552 1.906 0.826005 3.364 1.96001;
#X coords 0 5.2 10 -0.2 200 100 1 0 0;
#X restore 310 136 graph;
#N canvas 0 22 450 300 (subpatch) 0;
#X array array88 10 float 3;
#A 0 0.502 0.771999 1.096 1.582 2.122 2.662 3.20199 3.57999 3.95799 4.44399;
#X coords 0 5.2 10 -0.2 200 100 1 0 0;
#X restore 309 263 graph;
#X obj 68 212 tabread~ array77 array88;
#X msg 124 137 set array77 array88;
#X msg 137 168 set array88 array77;
#X obj 68 334 snapshot~;
#X floatatom 68 363 8 0 0 0 - - - 0;
#X obj 89 291 r bang;
#X obj 149 334 snapshot~;
#X floatatom 149 363 8 0 0 0 - - - 0;
#X text 51 21 [tabread~] generates multichannel signals if you give it more than one argument. Each channel then corresponds to an argument/table. The "set" message can also replace more than one table name. Note that the arrays do not need to be of the same length., f 66;
#X connect 0 0 8 0;
#X connect 0 1 11 0;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 5 0 0 0;
#X connect 6 0 5 0;
#X connect 7 0 5 0;
#X connect 8 0 9 0;
#X connect 10 0 8 0;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
#X restore 486 356 pd multichannel;
#X text 335 341 mutichannel signal support ----------->, f 20;
#X obj 125 319 metro 200;
#X obj 125 291 loadbang;
#X obj 125 350 s bang;
#X obj 53 304 r bang;
#X text 591 445 updated for Pd version 0.54;
#X text 55 67 [tabread~] looks up values from named arrays. Incoming values are truncated to the next lower integer \, and values out of bounds get the nearest (first or last) point., f 87;
#X connect 0 0 3 0;
#X connect 1 0 19 0;
#X connect 2 0 1 0;
#X connect 18 0 19 0;
#X connect 19 0 0 0;
#X connect 30 0 29 0;
#X connect 34 0 36 0;
#X connect 35 0 34 0;
#X connect 37 0 0 0;
