#N canvas 158 37 1074 752 12;
#X text 105 13 MORE ON ARRAYS;
#X obj 522 231 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X msg 522 258 \; array98 vis \$1;
#X msg 548 683 \; array98 style \$1;
#X floatatom 529 460 4 1 10 0 - - - 0;
#X floatatom 741 512 5 0 0 0 - - - 0;
#X msg 741 538 \; array98 color \$1;
#X msg 741 482 9, f 2;
#X msg 770 482 900;
#X text 36 138 set array values from index 0;
#X text 309 129 sets two values from index 3, f 17;
#X text 30 39 Arrays have methods to set their values explicitly. Below you can set their "bounds" rectangles \, rename them (but if you have two with the same name this won't necessarily do what you want) and add markings. To set values by message \, send a list whose first element gives the index to start at. Indices count up from zero., f 66;
#X msg 28 166 \; array98 0 -1 1 -1 1 -1 1 -1;
#X text 786 512 set color;
#X floatatom 548 653 5 0 0 0 - - - 0;
#X msg 302 166 \; array97 3 -0.5 0.5;
#X msg 27 234 \; array97 rename george;
#X msg 231 234 \; george rename array97;
#X msg 28 307 \; array97 bounds 0 2 10 -2;
#X msg 29 416 \; array97 xticks 0 1 1;
#X msg 222 415 \; array97 yticks 0 0.1 5;
#X msg 304 515 \; array97 ylabel -0.1 -1 0 1;
#X msg 523 325 \; array97 vis \$1;
#N canvas 162 212 568 393 locality 0;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-array 10 float 3;
#A 0 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5;
#A color 0;
#A width 2;
#X coords 0 1 10 -1 200 140 1;
#X restore 68 112 graph;
#X obj 401 170 send \$0-array;
#X obj 319 105 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X msg 401 140 const 0.5;
#X msg 319 202 \; \$1-array const -0.5;
#X obj 319 154 float \$0;
#X text 38 292 You can use "\$0" in an array name wherever you want as above. If you need to send a message to the array \, use the [send] object or load the "\$0" in a [float] object and pass it to a message used as a send. This is because "\$0" doesn't get expanded in messages., f 69;
#X text 31 18 '\$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 text 342 105 <-- click;
#X connect 2 0 5 0;
#X connect 3 0 1 0;
#X connect 5 0 4 0;
#X restore 254 692 pd locality;
#X msg 723 639 0;
#X msg 713 602 1;
#X text 746 596 allow editing with mouse, f 13;
#X text 752 632 prevent mouse interaction, f 14;
#X msg 713 669 \; array97 edit \$1 \; array98 edit \$1;
#X text 25 573 You can also change the x and y range and size in the "properties" dialog. Note that information about size and ranges is saved \, but ticks and labels are lost between Pd sessions. The contents of the array may be saved as part of the patch or discarded. This is set in the 'properties" dialog as well., f 62;
#X text 27 212 renaming an array;
#X text 26 285 setting the bounds rectangle;
#X text 103 476 adding labels: give a y value and a bunch of x values or vice versa, f 37;
#X text 25 363 adding x and y labels: give a point to put a tick \, the interval between ticks \, and the number of ticks overall per large tick;
#X obj 523 299 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 548 587 vradio 19 1 0 3 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0;
#X text 572 587 Point (0);
#X text 572 606 Polygon (1);
#X text 572 626 Bezier (2);
#X text 542 557 set display style:;
#X obj 694 206 cnv 19 298 148 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array array97 5 float 9;
#A 0 0.486666 0.126666 0.566675 -0.5 0.5;
#A color 0;
#A width 1;
#X array array98 7 float 9;
#A 0 -1 1 -1 1 -1 1 -1;
#A color 900;
#A width 1;
#X coords 0 1 7 -1 300 150 1 0 0;
#X restore 693 205 graph;
#X text 507 130 For last \, there are methods to change the visual appearance of arrays (and you can use a canvas [cnv] to set background color as in this example):, f 67;
#X msg 683 482 444;
#X msg 255 305 \; array97 bounds 0 1 7 -1;
#X msg 715 482 0, f 2;
#X text 562 461 line width;
#X msg 418 683 \; array97 style \$1;
#X msg 529 491 \; array97 width \$1 \; array98 width \$1;
#X text 102 679 open subpatch for local array names -->, f 21;
#X text 507 22 You can put more than one array in a single "graph" (which is Pd's name for the bounding rectangle \, and is a synonym for "canvas".) In this case you need to click on an exact point of one of the arrays to drag and change values. Note that arrays' sizes need not match the bounds of the containing graph. But if you have only one array in a graph and resize it \, the graph is automatically reset to match its bounds., f 67;
#X msg 20 515 \; array97 xlabel -1.075 0 1 2 3 4 5 6 7;
#X obj 672 378 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 830 378 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X msg 672 405 \; array98 visname \$1;
#X msg 830 404 \; array97 visname \$1;
#X text 510 198 show/hide arrays:;
#X text 568 395 show/hide array names:, f 12;
#X obj 904 639 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X msg 904 669 \; array98 keep \$1;
#X text 906 591 Change "save contents" flag, f 14;
#X text 885 476 Colors are set in the same way as other data structures. The first digit is Red \, the second is Green and the third is Blue., f 22;
#X connect 1 0 2 0;
#X connect 4 0 48 0;
#X connect 5 0 6 0;
#X connect 7 0 5 0;
#X connect 8 0 5 0;
#X connect 14 0 3 0;
#X connect 14 0 47 0;
#X connect 24 0 28 0;
#X connect 25 0 28 0;
#X connect 34 0 22 0;
#X connect 35 0 14 0;
#X connect 43 0 5 0;
#X connect 45 0 5 0;
#X connect 52 0 54 0;
#X connect 53 0 55 0;
#X connect 58 0 59 0;
