#N struct array-help-struct float x float y array z float;
#N struct float float y;
#N struct array-help-struct2 float x float y array z element-struct2
;
#N struct element-struct2 float x float y float w;
#N canvas 463 23 586 516 12;
#X text 420 153 (click for details:), f 11;
#N canvas 561 26 758 712 define 0;
#X text 340 522 creation arguments:;
#X text 370 593 optional name;
#X text 231 149 read from a file;
#X text 251 174 write to a file;
#X text 55 68 "array define" maintains an array and can name it so
that other objects can find it (and later should have some alternative
\, anonymous way to be found)., f 80;
#X text 369 610 optional size (100 by default);
#X msg 33 118 const 0;
#X text 91 118 set to a constant (0 \, for instance);
#X msg 41 149 read array-object-help.txt;
#X msg 53 174 write array-object-help.txt;
#X obj 46 514 array define array-help-1;
#X msg 60 205 resize 100;
#X text 79 235 ... other messages are also forwarded to the array like
those above - xticks \, etc \, and also lists to set values.;
#X obj 145 395 r array-help-send;
#X floatatom 145 443 5 0 0 0 - - - 0;
#X obj 355 390 r array-help-send;
#X floatatom 355 464 5 0 0 0 - - - 0;
#X text 61 488 click to open or edit array:;
#X obj 145 419 getsize float-array z;
#X obj 355 439 array size -s float-array z;
#X text 140 344 The pointer will be to a structure float-array and
the array itself will be the field named 'z' \, so that you can access
it as shown in these examples:;
#X obj 57 546 array define -k array-help-2 10;
#A 0 -0.320006 0 0 0 0 0 0 0 0 0;
#X msg 75 315 send array-help-send;
#X text 368 540 optional -k flag to keep contents;
#X obj 58 577 array define -yrange -4 4 array-help-3 10;
#X obj 58 608 array define -pix 800 400 array-help-4 16;
#X text 369 557 optional "-yrange low high" to set the yrange;
#X text 369 575 optional "-pix x y" to set the plot size;
#X obj 69 285 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X text 92 282 bang to output a pointer to the scalar containing the
array;
#X obj 46 645 getsize float-array z;
#X floatatom 46 669 5 0 0 0 - - - 0;
#X text 231 315 send pointer to a named receive object;
#X text 488 145 If created without any arguments \, the array object
defaults to 'array define', f 28;
#X obj 437 153 array;
#X obj 355 414 trigger bang pointer;
#X text 288 639 note: if "-k" is given but no size is specified \,
the size is restored to whatever it may have been changed to using
"resize" messages \, but if there is a size argument given the restored
array has the originally specified size.;
#X text 643 17 <= click;
#N canvas 778 172 578 386 reference 0;
#X obj 9 49 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000
0;
#X obj 9 161 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 9 201 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 8 358 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X obj 35 15 array define;
#X text 132 14 - create an array.;
#X text 94 60 bang - output a pointer to the scalar containing the
array., f 64;
#X text 31 81 send <symbol> - send pointer to a named receive object
, f 73;
#X text 122 169 pointer - a pointer to the scalar containing the array.
;
#X text 87 234 -k: saves/keeps the contents of the array with the patch.
;
#X text 87 252 -yrange <float \, float>: set minimum and maximum plot
range.;
#X text 87 271 -pix <float \, float>: set x and y graph size.;
#X text 25 105 other messages - [array define] send other messages
that arrays understand like: 'const' \, 'resize' \, etc. For reference
\, see 2.control.examples "15.array" and "16.more.arrays"., f 74;
#X obj 9 227 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 298 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X text 103 308 1) symbol - array name (default: internal numbered
'table#')., f 62;
#X text 110 330 2) float - size and also xrange (default: 100).;
#X restore 540 18 pd reference;
#X obj 14 51 cnv 1 725 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X obj 37 18 array define;
#X text 138 18 - create \, store \, and/or edit an array.;
#X connect 6 0 10 0;
#X connect 8 0 10 0;
#X connect 9 0 10 0;
#X connect 10 0 30 0;
#X connect 11 0 10 0;
#X connect 13 0 18 0;
#X connect 15 0 35 0;
#X connect 18 0 14 0;
#X connect 19 0 16 0;
#X connect 22 0 10 0;
#X connect 28 0 10 0;
#X connect 30 0 31 0;
#X connect 35 0 19 0;
#X connect 35 1 19 1;
#X restore 421 194 pd define;
#X obj 37 218 array size;
#X text 151 194 - create \, store \, and/or edit one;
#X text 151 218 - get or change size;
#X text 151 242 - sum all or a range of elements;
#N canvas 561 23 672 696 array-and-data-structures 0;
#X obj 220 212 pointer;
#N canvas 814 134 468 210 array-help-struct 0;
#X obj 36 88 filledpolygon 0 0 0 0 0 0 10 20 10 20 0 0 0;
#X obj 36 61 struct array-help-struct float x float y array z float
;
#X obj 40 119 plot z 500 2 25 5 5;
#X restore 430 123 pd array-help-struct;
#N canvas 916 175 353 251 array-help-data 0;
#X scalar array-help-struct 84 93 \; 0 \; 0 \; -1 \; -6 \; -9 \; -10
\; -5 \; -2 \; 5 \; -7 \; -41 \; -47 \; -45 \; -34 \; -17 \; 8 \; 5
\; 2 \; -2 \; -11 \; -16 \; -26 \; -43 \; 16 \; 24 \; 26 \; 21 \; 20
\; 19 \; 17 \; 16 \; 16 \; 16 \; 16 \; 12 \; \;;
#X text 65 167 We have one datum... right-click for properties to see
contents., f 32;
#X restore 430 99 pd array-help-data;
#X msg 220 168 traverse pd-array-help-data \, next, f 28;
#X obj 90 166 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 90 241 array sum -s array-help-struct z, f 19;
#X floatatom 90 282 5 0 0 0 - - - 0;
#X text 29 14 The array objects can also reference arrays within structures
via pointers. The "-s" flag takes two arguments \, specifying the data
structure and the field within it that will contain the array. By default
the array should be a simple floating point array (use the template
"float" for the array elements) but you can override that using "-f"
as shown further down., f 81;
#X obj 311 512 pointer;
#X obj 97 462 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X floatatom 97 580 5 0 0 0 - - - 0;
#N canvas 848 269 447 373 array-help-struct2 0;
#X obj 237 232 pointer;
#X msg 37 200 20 20;
#X obj 40 92 filledpolygon 0 0 0 0 0 0 10 20 10 20 0 0 0;
#X obj 40 54 struct array-help-struct2 float x float y array z element-struct2
;
#X msg 237 175 traverse pd-array-help-struct2 \, bang, f 22;
#X obj 37 260 append array-help-struct2 x y;
#X obj 43 118 plot z 500 2 25 5;
#X connect 0 0 5 2;
#X connect 1 0 5 0;
#X connect 4 0 0 0;
#X restore 286 406 pd array-help-struct2;
#N canvas 818 190 399 321 array-help-data2 0;
#X scalar array-help-struct2 80 30 \; -54 200 10 \; 138 -10 3 \; -32
26 0 \; 109 141 8 \; 267 26 3 \; \;;
#X text 31 267 A structure whose array has (x \, y \, w) triples -
right-click to see contents., f 40;
#X restore 300 384 pd array-help-data2;
#X msg 311 471 traverse pd-array-help-data2 \, next, f 25;
#N canvas 830 245 407 149 element-struct2 0;
#X obj 39 58 struct element-struct2 float x float y float w;
#X restore 306 429 pd element-struct2;
#X obj 97 539 array sum -s array-help-struct2 z -f element-struct2
w, f 31;
#X text 146 580 sum of all the 'w' values in the array;
#X text 237 244 when "-s" is given this inlet takes a pointer in place
of a name., f 35;
#X text 441 406 <= main structure;
#X text 441 429 <= element structure;
#X obj 97 494 trigger bang bang;
#X text 441 384 <= click for the array;
#X text 16 321 Using an additional '-f' flag we can specify which field
in the array we're referring to. In this example the array has (x \,
y \, w) triples (in [struct element-struct2]) and we're asking for
the "w" field using the "-f" flag and its two arguments (struct name
and field name)., f 85;
#X obj 90 194 t b b;
#X text 267 100 click for the array =>;
#X text 309 124 the structure =>;
#X text 135 282 sum of all the 'z' values in the array;
#X text 37 627 To know more about Data Structures \, how to handle
pointers and see examples \, please refer to the 4.Data.Structure section
of the Pd's tutorials., f 50;
#X obj 410 627 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#N canvas 491 316 412 249 open 0;
#X obj 58 49 inlet;
#X obj 58 105 pdcontrol;
#X msg 58 78 dir;
#X msg 58 132 \; pd open 01.scalars.pd \$1/../4.data.structures;
#X connect 0 0 2 0;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X restore 410 657 pd open;
#X text 468 625 open first examle of the 4.Data.Structure section.
, f 20;
#X text 432 626 <---;
#X connect 0 0 5 2;
#X connect 3 0 0 0;
#X connect 4 0 23 0;
#X connect 5 0 6 0;
#X connect 8 0 15 2;
#X connect 9 0 20 0;
#X connect 13 0 8 0;
#X connect 15 0 10 0;
#X connect 20 0 15 0;
#X connect 20 1 13 0;
#X connect 23 0 5 0;
#X connect 23 1 3 0;
#X connect 28 0 29 0;
#X restore 341 423 pd array-and-data-structures;
#N canvas 640 168 530 337 size 0;
#X floatatom 53 146 5 1 100 0 - - - 0;
#X obj 36 267 print;
#X text 31 64 "array size" outputs the size (if sent a bang) or sets
the size (if sent a number)., f 64;
#X obj 38 116 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X text 221 213 creations arguments: either array name or "-s" and
optional "-f" flags to refer to an array in a data structure, f 40
;
#X msg 205 179 symbol array-help-2;
#X text 344 143 inlet to set name or pointer, f 15;
#X text 98 145 number to set size, f 9;
#X text 62 115 bang outputs size;
#X msg 194 150 symbol array-help-1;
#X obj 5 49 cnv 1 515 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X text 440 16 <= click;
#N canvas 539 49 574 396 reference 0;
#X obj 9 52 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 8 85 cnv 1 550 1 empty empty 1st: 8 12 0 13 #000000 #000000
0;
#X obj 9 204 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 8 370 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X obj 38 17 array size;
#X text 125 16 - output or set array size;
#X text 124 92 bang - output the array size., f 45;
#X obj 7 144 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X text 118 117 float - set the array size., f 46;
#X text 112 153 symbol - set array name., f 46;
#X text 124 211 float - array size.;
#X text 106 173 pointer - pointer to the array if -s flag is used.
;
#X text 70 287 -s <symbol \, symbol>: struct name and field name of
main structure., f 69;
#X text 70 305 -f <symbol \, symbol>: struct name and field name of
element structure., f 69;
#X obj 9 250 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 9 276 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 328 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X text 107 337 1) symbol - array name if no flags are given (default:
none)., f 61;
#X restore 346 17 pd reference;
#X obj 27 17 array size;
#X text 114 16 - get or change size;
#X floatatom 36 238 5 1 100 0 - - - 0;
#X obj 36 210 array size array-help-2;
#X text 117 284 (array-help-2 is defined in the "define" subwindow).
;
#X connect 0 0 16 0;
#X connect 3 0 16 0;
#X connect 5 0 16 1;
#X connect 9 0 16 1;
#X connect 15 0 1 0;
#X connect 16 0 15 0;
#X restore 421 218 pd size;
#X obj 37 194 array define;
#X text 50 423 accessing arrays inside data structures:;
#X text 34 56 In Pd an array may be part of a "garray" (a graphical
array of numbers) or appear as a slot in a data structure (in which
case the elements may be arbitrary data \, not necessarily just numbers).
The "array" object can define an array (so far just of numbers but
maybe later arbitrary data structures) or access an array defined elsewhere
to get or change its size \, set or read its elements \, and so on.
, f 72;
#X text 40 165 The first argument sets its function:;
#X obj 37 242 array sum;
#X obj 37 314 array quantile;
#N canvas 560 199 646 397 sum 0;
#X floatatom 81 153 5 0 10 0 - - - 0;
#X obj 63 123 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X floatatom 63 301 5 0 0 0 - - - 0;
#X floatatom 103 185 5 -1 10 0 - - - 0;
#X text 38 69 "array sum" outputs the sum of all or a selected range
of elements of the array., f 66;
#X obj 63 256 array sum array-help-2, f 12;
#X text 181 295 - optional number to initialize onset - default 0;
#X text 181 314 - optional number to initialize number of points -
default -1, f 61;
#X text 89 123 bang to output sum;
#X text 182 259 creation arguments: either array name or "-s" and optional
"-f" flags to refer to an array in a data structure;
#X text 123 154 onset (first index to sum from) \, zero for start of
array;
#X text 145 185 number of points or -1 for end of array;
#X text 104 359 (array-help-2 is defined in the "define" subwindow).
;
#X msg 144 222 symbol array-help-2;
#X text 288 221 set name or pointer;
#X text 558 17 <= click;
#N canvas 733 117 575 458 reference 0;
#X obj 9 52 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 8 85 cnv 1 550 1 empty empty 1st: 8 12 0 13 #000000 #000000
0;
#X obj 9 226 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 8 429 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X obj 7 171 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000
0;
#X text 112 176 symbol - set array name., f 46;
#X text 124 235 float - array size.;
#X text 106 196 pointer - pointer to the array if -s flag is used.
;
#X text 68 307 -s <symbol \, symbol>: struct name and field name of
main structure., f 67;
#X text 68 325 -f <symbol \, symbol>: struct name and field name of
element structure., f 69;
#X obj 38 17 array sum;
#X text 125 16 - output the sum of the array or a range selecion.;
#X text 124 90 bang - output sum., f 49;
#X text 117 110 float - onset (index to sum from \, 0 is the start).
;
#X obj 7 133 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X text 65 144 float - number or points to sum from onset (-1 is the
end of array)., f 68;
#X obj 9 272 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 9 300 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 352 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X text 77 361 1) symbol - array name if no flags are given (default:
none)., f 61;
#X text 84 381 2) float - initial onset (default: 0).;
#X text 84 401 3) float - initial number of points (default: -1 \,
end of array)., f 64;
#X restore 464 17 pd reference;
#X obj 11 53 cnv 1 625 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X text 105 18 - sum all or a range of elements;
#X obj 31 17 array sum;
#X connect 0 0 5 0;
#X connect 1 0 5 0;
#X connect 3 0 5 1;
#X connect 5 0 2 0;
#X connect 13 0 5 2;
#X restore 421 242 pd sum;
#X obj 37 266 array get;
#N canvas 614 191 645 403 get 0;
#X floatatom 67 141 5 0 10 0 - - - 0;
#X obj 48 106 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X floatatom 89 174 5 -1 10 0 - - - 0;
#X obj 49 253 array get array-help-2, f 12;
#X text 74 57 "array get" outputs all or a selected range of elements
of the array as a list., f 63;
#X text 150 270 - optional number to initialize onset - default 0,
f 61;
#X text 150 287 - optional number to initialize number of points -
default -1, f 61;
#X text 150 239 creation arguments: either array name or "-s" and optional
"-f" flags to refer to an array in a data structure, f 61;
#X text 131 174 number of points or -1 for end of array;
#X text 70 106 bang for output;
#X text 184 359 (array-help-2 is defined in the "define" subwindow).
;
#X msg 130 203 symbol array-help-2;
#X text 275 202 set name or pointer;
#X text 109 141 onset (first index to output) \, zero for start of
array;
#X listbox 49 324 70 0 0 0 - - - 0;
#X obj 49 361 print array-get;
#X text 551 14 <= click;
#N canvas 722 105 568 482 reference 0;
#X obj 9 45 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 8 78 cnv 1 550 1 empty empty 1st: 8 12 0 13 #000000 #000000
0;
#X obj 9 256 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 8 455 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X obj 7 196 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000
0;
#X text 112 205 symbol - set array name., f 46;
#X text 106 225 pointer - pointer to the array if -s flag is used.
;
#X text 69 332 -s <symbol \, symbol>: struct name and field name of
main structure., f 67;
#X text 69 350 -f <symbol \, symbol>: struct name and field name of
element structure., f 69;
#X obj 7 145 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X obj 38 13 array get;
#X text 116 12 - output all items of the array or a range selecion.
;
#X text 124 85 bang - output the elements of the array., f 49;
#X text 118 110 float - onset (index to output from \, 0 is the start).
;
#X text 50 164 float - number or points to output from onset (-1 is
the end of array)., f 71;
#X obj 9 299 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 9 327 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 379 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X text 86 390 1) symbol - array name if no flags are given (default:
none)., f 61;
#X text 93 410 2) float - initial onset (default: 0).;
#X text 93 430 3) float - initial number of points (default: -1 \,
end of array)., f 64;
#X text 124 265 list - array's elements.;
#X restore 457 15 pd reference;
#X obj 9 43 cnv 1 625 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X obj 32 13 array get;
#X text 106 13 - get contents as a list;
#X connect 0 0 3 0;
#X connect 1 0 3 0;
#X connect 2 0 3 1;
#X connect 3 0 14 0;
#X connect 11 0 3 2;
#X connect 14 0 15 0;
#X restore 421 266 pd get;
#X obj 37 290 array set;
#N canvas 582 234 597 354 set 0;
#X obj 46 225 array set array-help-2, f 12;
#X msg 46 129 0.1 0.2 0.3 0.4 0.3 0.2 0.1;
#X floatatom 86 163 5 0 0 0 - - - 0;
#X text 129 163 onset (first index to write to);
#X text 156 267 - optional number to initialize onset - default 0;
#X text 160 230 creation arguments: either array name or "-s" and optional
"-f" flags to refer to an array in a data structure;
#X text 245 130 list of values to write to array;
#X text 110 309 (array-help-2 is defined in the "define" subwindow).
;
#X msg 127 192 symbol array-help-2;
#X text 273 191 set name or pointer;
#X text 504 16 <= click;
#N canvas 701 101 579 437 reference 0;
#X obj 9 55 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 8 88 cnv 1 550 1 empty empty 1st: 8 12 0 13 #000000 #000000
0;
#X obj 9 229 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 8 408 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X obj 7 170 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000
0;
#X text 112 178 symbol - set array name., f 46;
#X text 106 198 pointer - pointer to the array if -s flag is used.
;
#X text 69 305 -s <symbol \, symbol>: struct name and field name of
main structure., f 67;
#X text 69 323 -f <symbol \, symbol>: struct name and field name of
element structure., f 69;
#X obj 7 130 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X text 124 238 list - array elements.;
#X obj 38 20 array set;
#X text 116 19 - set all items of the array or a range selecion.;
#X text 118 99 list - list of values to write to array;
#X text 117 140 float - onset (index to set from \, 0 is the start).
, f 51;
#X obj 9 271 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 9 299 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 349 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X text 94 361 1) symbol - array name if no flags are given (default:
none)., f 61;
#X text 101 381 2) float - initial onset (default: 0).;
#X restore 410 17 pd reference;
#X obj 7 47 cnv 1 575 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X obj 25 17 array set;
#X text 103 16 - set contents from a list;
#X text 21 62 "array set" sets values of an array from an incoming
list \, starting from a specified onset (0 by default). The size of
the array is not changed - values that would be written past the end
of the array are dropped., f 77;
#X connect 1 0 0 0;
#X connect 2 0 0 1;
#X connect 8 0 0 2;
#X restore 421 290 pd set;
#X text 150 266 - get contents as a list;
#X text 150 290 - set contents from a list;
#X text 150 314 - get a quantile;
#X obj 37 338 array random;
#N canvas 539 30 699 671 quantile+random 0;
#X floatatom 64 243 5 0 100 0 - - - 0;
#X obj 33 340 array quantile array-help-5, f 14;
#N canvas 0 50 450 250 (subpatch) 0;
#X array array-help-5 100 float 1;
#A 0 0 0 0 0 0 0 0 0 0 0 0 0.00715053 0.00715053 0.0285789 0.0500072
0.0714356 0.100007 0.128578 0.164292 0.207148 0.478574 0.628573 0.678572
0.721429 0.717857 0.714286 0.707143 0.7 0.692857 0.685715 0.678572
0.18572 0.164292 0.157149 0.0142931 -0.00713521 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.014293 0.0214357 0.0357213 0.078578
0.142863 0.207148 0.335718 0.407146 0.435717 0.478574 0.514288 0.557144
0.592858 0.642858 0.7 0.692857 0.692857 0.692857 0.692857 0.7 0.696429
0.349997 0.335712 0.321426 0.278569 0.192856 0.149999 0.135714 0.114285
0.0999998 0.0714298 0.0642871 0.0571443 0.0285732 0 0 0 0 0;
#X coords 0 1 99 0 200 140 1 0 0;
#X restore 444 183 graph;
#X floatatom 96 278 5 -1 100 0 - - - 0;
#X floatatom 33 192 5 -1 100 0 - - - 0;
#X obj 33 217 / 100;
#X floatatom 33 384 5 0 100 0 - - - 0;
#X floatatom 80 635 5 0 100 0 - - - 0;
#X obj 80 591 array random array-help-5, f 13;
#X obj 80 443 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X floatatom 115 501 5 0 0 0 - - - 0;
#X floatatom 124 534 5 0 0 0 - - - 0;
#X text 103 443 bang to generate a random value;
#X msg 97 474 seed 56;
#X text 165 474 set random seed;
#X text 149 379 - optional number to initialize onset - default 0,
f 61;
#X text 148 398 - optional number to initialize number of points -
default -1, f 61;
#X text 198 605 same creation arguments;
#X text 156 346 creation arguments: either array name or "-s" and optional
"-f" flags to refer to an array in a data structure, f 60;
#X text 106 236 onset (first index to sum from) \, zero for start of
array, f 32;
#X text 138 279 number of points or -1 for end of array;
#X text 159 501 onset;
#X text 166 533 number of points;
#X text 78 191 quantile (between 0 and 1);
#X msg 128 315 symbol array-help-2;
#X text 273 313 set name or pointer;
#X msg 168 565 symbol array-help-2;
#X text 310 564 set name or pointer;
#X text 599 33 <= click;
#N canvas 188 138 1156 393 reference 0;
#X obj 10 42 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 10 192 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 9 358 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X obj 8 149 cnv 1 550 1 empty empty 4th: 8 12 0 13 #7c7c7c #000000
0;
#X text 126 152 symbol - set array name., f 49;
#X text 119 170 pointer - pointer to the array if -s flag is used.
;
#X text 69 260 -s <symbol \, symbol>: struct name and field name of
main structure., f 69;
#X text 69 278 -f <symbol \, symbol>: struct name and field name of
element structure., f 69;
#X obj 8 122 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000
0;
#X obj 26 16 array quantile;
#X text 144 15 - outputs the specified quantile.;
#X obj 9 96 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X text 133 99 float - array onset (o is the end of array).;
#X text 133 127 float - number or points (-1 is the end of array).
, f 51;
#X text 133 198 float - random index value from the array.;
#X obj 9 70 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000
0;
#X obj 588 37 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 588 203 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000
0;
#X obj 587 366 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X text 704 160 symbol - set array name., f 49;
#X text 697 178 pointer - pointer to the array if -s flag is used.
;
#X text 647 270 -s <symbol \, symbol>: struct name and field name of
main structure., f 69;
#X text 647 288 -f <symbol \, symbol>: struct name and field name of
element structure., f 69;
#X obj 586 157 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000
0;
#X text 701 10 - outputs the specified quantile.;
#X obj 587 131 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X text 711 209 float - random index value from the array.;
#X obj 587 65 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000
0;
#X obj 604 11 array random;
#X text 711 108 float - sets onset.;
#X text 662 90 seed <float> - sets random seed.;
#X text 718 72 bang - bang to generate a random value.;
#X text 711 134 float - set number of points (-1 is the end of the
array).;
#X obj 9 232 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 9 255 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 299 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X obj 588 242 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020
#000000 0;
#X obj 588 267 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 588 309 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X text 86 303 1) symbol - array name if no flags are given (default:
none)., f 62;
#X text 93 320 2) float - initial onset (default: 0)., f 61;
#X text 93 337 3) float - initial number of points (default: -1 \,
end of array)., f 64;
#X text 644 312 1) symbol - array name if no flags are given (default:
none)., f 62;
#X text 651 329 2) float - initial onset (default: 0)., f 61;
#X text 651 346 3) float - initial number of points (default: -1 \,
end of array)., f 64;
#X text 133 73 float - quantile (between 0 and 1).;
#X restore 505 33 pd reference;
#X obj 12 64 cnv 1 675 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X obj 36 13 array quantile;
#X text 148 13 - get a quantile;
#X obj 36 38 array random;
#X text 148 38 - array as probabilities;
#X text 122 636 index;
#X text 37 80 "array quantile" outputs the specified quantile by interpreting
the array as a histogram. The output will always be in the range from
0 to "array size - 1". The 0.5 quantile is also known as the median.
This generalizes the "array random" function allowing you to use the
same source of randomness on several arrays \, for example. Negative
numbers in the array are silently replaced by zero. Quantiles outside
the range 0-1 output the x values at the two extremes of the array
(0 and 99 here)., f 89;
#X text 360 460 "array random" makes a pseudo-random number from 0
to 1 and outputs its quantile (which will therefore have probabilities
proportional to the table's values.), f 36;
#X connect 0 0 1 1;
#X connect 1 0 6 0;
#X connect 3 0 1 2;
#X connect 4 0 5 0;
#X connect 5 0 1 0;
#X connect 8 0 7 0;
#X connect 9 0 8 0;
#X connect 10 0 8 0;
#X connect 11 0 8 1;
#X connect 13 0 8 0;
#X connect 24 0 1 3;
#X connect 26 0 8 2;
#X restore 421 327 pd quantile+random;
#X obj 37 361 array max;
#N canvas 579 106 640 567 min+max 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array array-help-6 100 float 1;
#A 0 0.335714 0.37857 0.421427 0.442855 0.478569 0.521426 0.535711
0.55714 0.585711 0.599997 0.614282 0.63571 0.649996 0.664282 0.671424
0.699995 0.699995 0.714281 0.721424 0.707138 0.699995 0.692853 0.68571
0.671424 0.649996 0.628568 0.599997 0.571425 0.514283 0.471426 0.414284
0.385713 0.357142 0.328571 0.3 0.285714 0.271429 0.25 0.228572 0.214286
0.207143 0.200001 0.185715 0.17143 0.164287 0.157144 0.150001 0.135716
0.128573 0.12143 0.12143 0.114287 0.114287 0.114287 0.114287 0.114287
0.12143 0.125001 0.128573 0.128573 0.135716 0.139287 0.142858 0.150001
0.157144 0.157144 0.164287 0.17143 0.200001 0.214286 0.228572 0.235715
0.242857 0.257143 0.271429 0.285714 0.307142 0.321428 0.335714 0.357142
0.371427 0.385713 0.399999 0.407141 0.414284 0.421427 0.42857 0.435713
0.442855 0.457141 0.460712 0.464284 0.471426 0.478569 0.485712 0.499998
0.50714 0.514283 0.521426 0.528569;
#X coords 0 1 99 0 200 140 1 0 0;
#X restore 351 402 graph;
#X floatatom 54 322 7 0 100 0 - - - 0;
#X obj 54 153 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X floatatom 73 184 5 0 0 0 - - - 0;
#X floatatom 98 219 5 0 0 0 - - - 0;
#X text 192 311 - optional number to initialize onset - default 0;
#X text 191 330 - optional number to initialize number of points -
default -1, f 61;
#X text 186 276 creation arguments: either array name or "-s" and optional
"-f" flags to refer to an array in a data structure;
#X text 113 183 onset;
#X text 140 218 number of points;
#X msg 142 249 symbol array-help-2;
#X text 284 249 set name or pointer;
#X obj 54 277 array max array-help-6, f 13;
#X floatatom 142 322 5 0 100 0 - - - 0;
#X text 76 152 bang to find maximum;
#X text 41 77 "array max" and "array min" find the maximum and minimum
values in the array \, respectively. The first outlet is the value
and the second is the index (the x location where the value was found).
The search may be restricted to a sub-domain of the array by specifying
the "onset" and "number of points"., f 77;
#X floatatom 110 531 7 0 100 0 - - - 0;
#X obj 110 392 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X floatatom 123 415 5 0 0 0 - - - 0;
#X floatatom 154 448 5 0 0 0 - - - 0;
#X text 168 412 onset;
#X floatatom 198 531 5 0 100 0 - - - 0;
#X text 132 389 bang to find minimum;
#X text 203 446 number of points;
#X obj 110 486 array min array-help-6, f 13;
#X text 53 345 value;
#X text 137 346 index;
#X text 533 27 <= click;
#N canvas 637 123 579 454 reference 0;
#X obj 9 43 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000
0;
#X obj 8 71 cnv 1 550 1 empty empty 1st: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 205 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000
0;
#X obj 8 426 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X obj 7 153 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000
0;
#X text 112 159 symbol - set array name., f 46;
#X text 106 179 pointer - pointer to the array if -s flag is used.
;
#X text 68 318 -s <symbol \, symbol>: struct name and field name of
main structure., f 67;
#X text 68 336 -f <symbol \, symbol>: struct name and field name of
element structure., f 69;
#X obj 7 119 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X text 117 95 float - onset (index to output from \, 0 is the start).
;
#X text 50 128 float - number or points to output from onset (-1 is
the end of array)., f 71;
#X obj 28 13 array min;
#X text 186 12 - output minimum and maximum values of an array;
#X obj 108 13 array max;
#X obj 8 228 cnv 1 550 1 empty empty 1st: 8 12 0 13 #9f9f9f #000000
0;
#X obj 7 253 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000
0;
#X text 122 231 float - minimum or maximum value;
#X text 124 77 bang - to find min or maximum., f 52;
#X text 122 256 float - index of found value;
#X obj 9 291 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000
0;
#X obj 9 314 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000
0;
#X obj 9 361 cnv 1 550 1 empty empty args: 8 12 0 13 #7c7c7c #000000
0;
#X text 79 366 1) symbol - array name if no flags are given (default:
none)., f 62;
#X text 86 384 2) float - initial onset (default: 0)., f 61;
#X text 86 402 3) float - initial number of points (default: -1 \,
end of array)., f 64;
#X restore 439 27 pd reference;
#X obj 7 62 cnv 1 625 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X obj 36 12 array max;
#X obj 36 35 array min;
#X text 113 36 - min - find lowest value;
#X text 112 12 - max - find highest value;
#X connect 2 0 12 0;
#X connect 3 0 12 0;
#X connect 4 0 12 1;
#X connect 10 0 12 2;
#X connect 12 0 1 0;
#X connect 12 1 13 0;
#X connect 17 0 24 0;
#X connect 18 0 24 0;
#X connect 19 0 24 1;
#X connect 24 0 16 0;
#X connect 24 1 21 0;
#X restore 421 372 pd min+max;
#X obj 37 384 array min;
#X obj 178 472 list;
#X obj 84 472 text;
#X obj 124 472 scalar;
#X text 367 471 updated for Pd version 0.52;
#X obj 4 41 cnv 1 575 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X text 74 12 - define \, access and manipulate arrays;
#X text 501 12 <= click;
#N canvas 787 173 579 214 reference 0;
#X obj 7 143 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X text 73 18 - define \, access and manipulate arrays;
#X obj 8 75 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000
0;
#X text 96 85 symbol -;
#X obj 7 54 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000
0;
#X text 160 86 sets the function of [array] \, possible values: define
\, size \, sum \, get \, set \, quantile \, random \, max and min.
The default value is 'define'., f 54;
#X obj 26 18 array;
#X text 119 162 Open specific references in each subpatch detailing
each function on parent patch., f 41;
#X restore 407 11 pd reference;
#X obj 29 11 array;
#X obj 4 456 cnv 1 575 1 empty empty empty 8 12 0 13 #000000 #000000
0;
#X text 150 338 - array as probabilities;
#X text 150 361 - find highest value;
#X text 150 384 - find lowest value;
#X text 11 471 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 225 472 pd array-examples;
