#N canvas 236 89 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 200 165 "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:;
#X msg 88 170 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 631 366 pd Dealing_with_"\$0";
#X text 625 332 open subpatch to see how to deal with '\$0', f 22;
#N canvas 642 233 579 245 reference 0;
#X obj 18 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 18 138 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 18 190 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0;
#X obj 17 227 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 68 86 set <list> -;
#X text 75 161 signal(s) -;
#X text 114 199 1) list - sets table names to read from.;
#X text 159 161 value(s) of index input from given table(s).;
#X text 159 86 set the table names. No argument unsets the object. Setting the table names also sets the number of channels., f 57;
#X text 75 66 signal(s) -;
#X text 159 66 sets index(es) for 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;
#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 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 obj 466 148 cnv 19 298 148 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 22 450 300 (subpatch) 0;
#X array tabread-ex 10 float 2;
#A color 0;
#A width 2;
#X coords 0 5.2 10 -0.2 300 150 1 0 0;
#X xlabel -0.4 0 1 2 3 4 5 6 7 8 9;
#X ylabel -0.3 0 1 2 3 4 5;
#X restore 465 147 graph;
#X text 359 339 mutichannel signal support ------>, f 20;
#N canvas 606 137 554 539 multichannel 0;
#X floatatom 54 194 6 0 10 0 - - - 0;
#X obj 53 352 tabread~ array77 array88;
#X msg 81 282 set array88 array77;
#X obj 53 455 snapshot~;
#X obj 74 417 r bang;
#X obj 308 265 cnv 19 198 98 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#X obj 307 392 cnv 19 198 98 empty empty empty 20 12 0 12 #e0e0e0 #404040 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;
#A color 0;
#A width 2;
#X coords 0 5.2 10 -0.2 200 100 1 0 0;
#X restore 307 264 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;
#A color 0;
#A width 2;
#X coords 0 5.2 10 -0.2 200 100 1 0 0;
#X restore 306 391 graph;
#X listbox 53 497 22 0 0 0 - - - 0;
#X msg 160 435 \; pd dsp \$1;
#X obj 160 400 set-dsp-tgl;
#X text 191 404 DSP on/off;
#X msg 96 310 set array77;
#X floatatom 107 194 6 0 0 0 - - - 0;
#X msg 68 255 set array77 array88 array77;
#X obj 54 220 sig~ 0 0;
#X text 30 23 The number of channels in [tabread~] depends on the maximum of input channels and given tables. If both are of the same size \, each input signal corresponds to an index of a given table. In case the numbers mismatch \, the smaller wraps around until reaching the number of the bigger one (like [*~] and other math objects). This is especially useful when you have a single input to read from many tables. The "set" message resets the table names and can change the number of signals in the output. Note that the arrays do not need to be of the same length and that you can repeat array names., f 66;
#X connect 0 0 16 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 11 0 10 0;
#X connect 13 0 1 0;
#X connect 14 0 16 1;
#X connect 15 0 1 0;
#X connect 16 0 1 0;
#X restore 478 363 pd multichannel;
#X msg 109 206 set;
#X text 142 205 no argument unsets the object, f 30;
#X text 591 445 updated for Pd version 0.56;
#X connect 0 0 3 0;
#X connect 1 0 18 0;
#X connect 2 0 1 0;
#X connect 17 0 18 0;
#X connect 18 0 0 0;
#X connect 29 0 28 0;
#X connect 31 0 33 0;
#X connect 32 0 31 0;
#X connect 34 0 0 0;
#X connect 40 0 18 0;
