#N canvas 360 57 843 544 12;
#N canvas 0 22 450 300 (subpatch) 0;
#X array table2-ex 10 float 3;
#A 0 1 4 2 8 5 6 1 1 4 2;
#X coords 0 10 10 0 250 150 1 0 0;
#X restore 565 132 graph;
#X obj 36 401 snapshot~;
#X obj 36 165 sig~;
#X floatatom 36 139 6 1 8 0 - - - 0;
#X floatatom 36 427 6 0 0 0 - - - 0;
#X obj 44 17 tabread4~;
#X obj 94 487 tabwrite~;
#X obj 229 487 tabread;
#X obj 288 487 tabwrite;
#X obj 353 487 tabsend~;
#X obj 94 513 tabreceive~;
#X obj 165 487 tabplay~;
#X floatatom 166 250 5 0 10 0 - - - 0;
#X obj 231 361 ../3.audio.examples/B15.tabread4~-onset;
#X obj 181 513 tabosc4~;
#X obj 249 513 soundfiler;
#N canvas 515 381 401 220 init-table 0;
#X obj 35 42 loadbang;
#X msg 35 74 \; table2-ex resize 10 \; table2-ex bounds 0 10 10 0 \; table2-ex xlabel -0.2 0 1 2 3 4 5 6 7 8 9 \; table2-ex ylabel -0.3 0 1 2 3 4 5 6 7 8 9 10 \; table2-ex 0 1 4 2 8 5 6 1 1 4 2;
#X connect 0 0 1 0;
#X restore 720 108 pd init-table;
#X obj 36 313 tabread4~ table2-ex;
#X msg 52 207 set table2-ex;
#X text 124 16 - 4-point-interpolating table lookup for signals;
#N canvas 773 305 593 441 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 159 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 msg 221 320 \; \$1-x 0 1 0 -1 0 1 0 -1 1 0 -1;
#X obj 221 264 loadbang;
#X obj 67 251 tabread4~;
#X obj 67 345 snapshot~;
#X obj 86 313 metro 200;
#X floatatom 67 371 6 0 0 0 - - - 0;
#X obj 86 289 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 10 0;
#X connect 3 0 12 0;
#X connect 4 0 3 0;
#X connect 5 0 4 0;
#X connect 8 0 12 0;
#X connect 11 0 2 0;
#X connect 12 0 13 0;
#X connect 13 0 15 0;
#X connect 14 0 13 0;
#X connect 16 0 14 0;
#X restore 576 422 pd Dealing_with_"\$0";
#X obj 39 111 hsl 162 19 1 8 0 0 empty empty empty -2 -8 0 10 #dfdfdf #000000 #000000 0 1;
#N canvas 750 87 575 293 reference 0;
#X obj 11 52 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 11 186 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 11 231 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0;
#X obj 10 268 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 37 20 tabread4~;
#X text 117 20 - 4-point-interpolating table lookup for signals.;
#X text 144 95 signal -;
#X obj 11 148 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0;
#X obj 11 85 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0;
#X text 151 157 float -;
#X text 207 157 sets table onset., f 42;
#X text 116 117 set <list> -;
#X text 207 117 set the table names., f 42;
#X text 123 198 signal(s) -;
#X text 207 198 value(s) of index input from given table(s).;
#X text 137 243 1) list - sets table names to read from.;
#X text 207 95 sets index for table(s) with interpolation.;
#X restore 662 17 pd reference;
#X text 760 16 <= click;
#X obj 8 50 cnv 1 830 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 245 322 Open this example for more details on setting onset:, f 35;
#X text 264 423 open subpatch to see how to deal with '\$0':;
#X obj 8 475 cnv 1 830 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 18 500 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 331 513 pd array-examples;
#X text 58 67 [tabread4~] is used to build samplers and other table lookup algorithms. The interpolation scheme is 4-point polynomial as used in [delread4~] and [tabosc4~]., f 90;
#X msg 457 234 \; pd dsp \$1;
#X obj 457 199 set-dsp-tgl;
#X text 374 202 DSP on/off;
#N canvas 749 203 563 414 multichannel 0;
#X obj 68 270 snake~ out, f 12;
#X obj 69 151 sig~;
#X floatatom 69 125 6 0 10 0 - - - 0;
#N canvas 0 22 450 300 (subpatch) 0;
#X array array99 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 149 graph;
#N canvas 0 22 450 300 (subpatch) 0;
#X array array100 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 276 graph;
#X obj 68 347 snapshot~;
#X floatatom 68 376 8 0 0 0 - - - 0;
#X obj 89 304 r bang;
#X obj 149 347 snapshot~;
#X floatatom 149 376 8 0 0 0 - - - 0;
#X msg 117 150 set array99 array100;
#X msg 130 181 set array100 array99;
#X obj 68 222 tabread4~ array99 array100;
#X text 51 12 [tabread4~] 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 67;
#X obj 72 96 hsl 162 19 0 10 0 0 empty empty empty -2 -8 0 10 #dfdfdf #000000 #000000 0 1;
#X connect 0 0 5 0;
#X connect 0 1 8 0;
#X connect 1 0 12 0;
#X connect 2 0 1 0;
#X connect 5 0 6 0;
#X connect 7 0 5 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 10 0 12 0;
#X connect 11 0 12 0;
#X connect 12 0 0 0;
#X connect 14 0 2 0;
#X restore 701 365 pd multichannel;
#X text 550 350 mutichannel signal support ----------->, f 20;
#X obj 128 392 metro 200;
#X obj 128 365 loadbang;
#X obj 128 420 s bang;
#X obj 56 368 r bang;
#X text 625 507 updated for Pd version 0.54;
#X text 89 137 incoming signal is index. Indices should range from 1 to (size-2) so that the 4-point interpolation is meaningful (from 1 to 8 in this example)., f 52;
#X text 212 245 set table onset to improve the accuracy of indexing (useful if you have Pd compiled for single precision), f 31;
#X text 157 200 "set" message lets you switch between arrays, f 22;
#X text 102 250 onset ->;
#X connect 1 0 4 0;
#X connect 2 0 17 0;
#X connect 3 0 2 0;
#X connect 12 0 17 1;
#X connect 17 0 1 0;
#X connect 18 0 17 0;
#X connect 21 0 3 0;
#X connect 32 0 31 0;
#X connect 36 0 38 0;
#X connect 37 0 36 0;
#X connect 39 0 1 0;
