#N canvas 491 28 560 656 10;
#X declare -stdpath ./;
#X obj 2 360 cnv 3 550 3 empty empty inlets 8 12 0 13 #d4d4d4 #000000 0;
#X obj 2 441 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 531 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 76 468 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 76 488 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 76 508 cnv 17 3 17 empty empty 3 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 76 448 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 76 366 cnv 17 3 67 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 2 624 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X text 177 539 -;
#X text 177 556 -;
#X text 115 557 2) float;
#X text 165 368 -;
#X text 130 368 bang;
#X text 165 401 -;
#X text 165 418 -;
#X text 146 488 bang;
#X text 146 508 bang;
#X text 115 539 1) symbol;
#N canvas 653 116 669 588 All_Messages 0;
#X text 117 187 length -;
#X text 129 247 next -;
#X text 129 307 open -;
#X text 129 322 prev -;
#X text 75 337 read <symbol> -;
#X text 99 352 readagain -;
#X text 69 367 refer <symbol> -;
#X text 123 457 start -;
#X text 15 502 subsym <symbol \, symbol> -;
#X text 117 533 wclose -;
#X text 174 534 closes the data window containing the collection, f 79;
#X text 69 548 write <symbol> -;
#X text 93 563 writeagain -;
#X text 174 337 opens file specified by the symbol (without a symbol \, a dialog window opens), f 79;
#X text 39 442 sort <float \, float> -;
#X text 174 548 saves file specified by the symbol (without a symbol \, a dialog window opens), f 79;
#X text 174 502 substitutes an address symbol (2nd element) by the first given symbol, f 79;
#X text 15 217 merge <int/symbol \, any> -;
#X text 174 247 same as bang: outputs next address and its data, f 79;
#X text 174 322 outputs previous address and its data, f 79;
#X text 174 352 reopen last file - if no file had been open \, a dialog box is shown, f 79;
#X text 39 382 remove <int/symbol> -;
#X text 174 563 resaves last file - if no file had been saved \, a dialog box is shown, f 79;
#X text 69 427 separate <int> -;
#X text 174 488 same as nsub \, but the substituted message is sent out, f 79;
#X text 174 172 same as insert \, but only increments if necessary to include the new address, f 79;
#X text 15 172 insert2 <int \, anything> -;
#X text 3 277 nstore <int \, symbol \, any> -;
#X text 15 517 swap <int/sym \, int/sym> -;
#X text 174 186 sends number of stored values to the left outlet, f 79;
#X text 174 217 sets address and any message to be appended to the stored message, f 79;
#X text 27 262 nth <int/symbol \, int> -;
#X text 87 232 min <float> -;
#X text 174 202 sends max value of all <nth> elements (starts at 1 \, default) on left outlet, f 79;
#X text 174 232 sends min value of all <nth> elements (starts at 1 \, default) on left outlet, f 79;
#X text 174 517 swaps data between two addresses, f 79;
#X text 99 202 max <int> -;
#X text 174 277 or <symbol \, int \, any>: stores any data to an int address with a symbol alias, f 79;
#X text 9 292 nsub <int/sym \, int \, any> -;
#X text 174 262 address and nth element to be output (starts at 1), f 79;
#X text 174 293 the address \, an element (starts at 1) and any value to substitute it to, f 79;
#X text 174 307 opens the window with the data collection (allows manual data editing), f 79;
#X text 174 367 refers to the data from another [coll] object with that symbol name, f 79;
#X text 174 382 removes address and its data without renumbering (unlike delete), f 79;
#X text 69 397 renumber <int> -;
#X text 174 397 lists int addresses consecutively \, argument sets starting value (default 0), f 79;
#X text 174 426 increments by 1 addresses from the given <int> and above (opening a slot), f 79;
#X text 33 472 store <int/sym \, any> -;
#X text 174 472 int or symbol address and any message to be stored at it, f 79;
#X text 15 487 sub <int/sym \, int \, any> -;
#X text 174 457 sets the pointer to the first entry/address, f 79;
#X text 174 442 <flag> -1: ascending / 1: descending \, <sort element> from 0 (-1 is address), f 79;
#X text 129 67 dump -;
#X text 39 7 assoc <symbol \, int> -;
#X text 27 37 deassoc <symbol \, int> -;
#X text 174 67 dumps all values (1st outlet) \, addresses (2nd) and bangs (4th) when done, f 79;
#X text 39 52 delete <int/symbol> -;
#X text 174 7 associates a symbol alias to an int address, f 79;
#X text 174 37 desassociates the symbol alias of an int address, f 79;
#X text 174 52 deletes the address (if an int \, higher addresses are decremented by 1), f 79;
#X text 123 22 clear -;
#X text 174 22 deletes all addresses (the complete data collection) from [coll], f 79;
#X text 135 82 end -;
#X text 51 112 filetype <symbol> -;
#X text 75 97 embed <float> -;
#X text 21 157 insert <int \, anything> -;
#X text 174 142 sets an address to go to (only sets the pointer \, no output), f 79;
#X text 174 157 an int address and any message to insert \, increments equal/greater addresses, f 79;
#X text 33 127 flags <float \, float> -;
#X text 174 97 <1> saves contents with the patch \, <0> doesn't, f 79;
#X text 174 127 first flag is the embed flag \, second is unused (just use 'embed' isntead), f 79;
#X text 51 142 goto <int/symbol> -;
#X text 174 82 sets the pointer to the last entry/address, f 79;
#X text 63 412 renumber2 <int> -;
#X text 174 412 increments int addresses by one \, starting from the given address (default 0), f 79;
#X text 174 112 sets file type to read/write (no symbol sets no extension: default), f 79;
#X restore 358 419 pd All_Messages;
#X text 106 418 messages;
#X obj 249 194 vradio 15 1 0 2 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X obj 205 259 print;
#X obj 250 260 nbx 2 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 265 194 0;
#X text 265 209 1;
#X text 123 449 anything;
#X obj 2 579 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X text 282 260 <= address;
#X obj 194 204 bng 18 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 178 508 - when finishing a dump operation;
#X text 121 147 click messages \; & store data ==>;
#X text 114 260 stored data =>;
#X text 317 144 list stored at address "0";
#X text 317 169 list stored at address "1";
#X text 130 401 list;
#X text 39 234 click to open text window ==>;
#X text 179 449 - the stored message at a given address;
#X text 180 418 open to check all messages =>;
#X msg 227 144 0 500 1000 hi;
#X msg 236 168 1 5 10 hello;
#X text 64 204 go to next address =>;
#X text 180 368 outputs next address and its data;
#X text 280 200 <= recall data from address;
#X text 69 85 [coll] stores/edits any messages at given addresses (an integer or a symbol). If an input list starts with an int \, it stores the other element(s) at that int address., f 64;
#X text 130 586 @embed: <1> save contents with the patch \, <0> don't save (default), f 66;
#X obj 227 234 cyclone/coll;
#C restore;
#X text 189 557 non-0 prevents from searching for a file (default 0);
#X text 146 604 @threaded: <1> threaded processing (default) \, <0> unthreaded;
#N canvas 605 84 622 576 details 0;
#N canvas 517 308 804 263 embbed 0;
#X msg 92 99 dump;
#X obj 93 219 print coll_embedded;
#X text 219 221 print address/data;
#X text 129 98 <= check Pd window;
#X msg 465 153 embed \$1;
#X obj 465 124 tgl 15 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 465 195 cyclone/coll;
#C restore;
#X obj 92 141 cyclone/coll @embed 1;
#C flags 1 0;
#C 0 zero;
#C 1 one;
#C 2 two;
#C 3 three;
#C restore;
#X text 23 19 By default \, the contents of [coll] are not saved as part of the patch \, but you can change that! Check the example below where the contents of [coll] were stored with this example patch. Dump the contents and check it.;
#X text 487 122 (1: saves with the patch \, 0: doesn't save);
#X obj 93 185 cyclone/join @triggers 1;
#X text 413 18 You can set [coll] to store its contents with the embed message / attribute plus the argument: "1" sets coll to store the data with the patch \, "0" (the default) to not save it. Note that changing the data collection is not enough \, you have to save the patch!;
#X connect 0 0 7 0;
#X connect 4 0 6 0;
#X connect 5 0 4 0;
#X connect 7 0 10 1;
#X connect 7 1 10 0;
#X connect 10 0 1 0;
#X restore 526 177 pd embbed;
#N canvas 488 133 807 482 sort 0;
#X msg 444 167 sort 1 -1;
#X obj 27 155 cyclone/prepend store;
#X obj 27 86 loadbang;
#X obj 402 329 cyclone/coll;
#C restore;
#X msg 402 110 dump;
#X obj 356 364 list prepend;
#X obj 356 387 list trim;
#X obj 471 428 print sort;
#X msg 471 379 ______________;
#X text 542 428 print address / data;
#X msg 422 145 sort -1 -1;
#X text 517 167 sort descending by address;
#X text 502 145 sort ascending by address;
#X msg 458 200 sort -1 0;
#X text 524 200 sort ascending by 1st element;
#X msg 468 221 sort 1 0;
#X text 534 221 sort descending by 1st element;
#X msg 478 260 sort -1 1;
#X msg 488 281 sort 1 1;
#X text 546 260 sort ascending by 2nd element;
#X text 556 281 sort descending by 2nd element;
#X text 400 23 The first argument is the sort order flag: -1 is ascending / 1 is descending. The second argument specifies which element in the message is used to sort \, starting at 0 (-1 sorts by the address).;
#X text 13 23 You can change the address order by sorting them. The 'sort' message can sort (in ascending or descending order) the entries by the address or an element in the data.;
#X text 438 109 <= check pd window;
#X text 90 87 store a collection in an unsorted order;
#X msg 27 114 two 2 two \, one 1 one \, three 3 three \, four 4 four \, 2 two 2 \, 1 one 1 \, 3 three 3 \, 5 five 5 \, 4 four 4;
#X connect 0 0 3 0;
#X connect 1 0 3 0;
#X connect 2 0 25 0;
#X connect 3 0 5 0;
#X connect 3 1 5 1;
#X connect 3 3 8 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 8 0 7 0;
#X connect 10 0 3 0;
#X connect 13 0 3 0;
#X connect 15 0 3 0;
#X connect 17 0 3 0;
#X connect 18 0 3 0;
#X connect 25 0 1 0;
#X restore 541 425 pd sort;
#X text 444 472 query data:;
#N canvas 421 155 901 540 swap_subsym 0;
#X obj 61 246 loadbang;
#X msg 103 299 1;
#X msg 138 299 2;
#X msg 170 497 Two;
#X obj 170 463 cyclone/prepend set;
#X msg 170 300 Three;
#X msg 214 300 Four;
#X msg 225 332 swap Three Four;
#X msg 244 356 swap 1 2;
#X msg 257 381 swap 2 Four;
#X text 250 300 <= addresses;
#X text 161 71 1 \, 100 \; 2 \, 200 \;;
#X text 43 29 The swap message takes two addresses (ints or symbols) and exchanges between them. For instance \, take the data below:;
#X text 45 110 If you swap the addresses \, here's what you get.;
#X text 164 135 2 \, 100 \; 1 \, 200 \;;
#X text 43 182 Note that the address is swapped \, not the data. Now try the example below.;
#X msg 582 205 Three;
#X msg 601 230 Four;
#X text 646 218 <= addresses;
#X obj 542 131 loadbang;
#X obj 170 430 cyclone/coll;
#C restore;
#X msg 542 157 store Three 3 \, store Four 4;
#X obj 540 411 cyclone/coll;
#C restore;
#X obj 540 444 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 642 342 Três;
#X msg 661 367 Quatro;
#X text 713 352 <= new addresses;
#X text 747 283 <= change addresses;
#X msg 622 272 subsym Três Three;
#X msg 627 299 subsym Quatro Four;
#X text 462 51 The subsym message substitutes a symbol address by another \, the first symbol is the new address name and the second is the address to be substituted.;
#X msg 61 272 store 1 One \, store 2 Two \, store Three 3 \, store Four 4;
#X connect 0 0 31 0;
#X connect 1 0 20 0;
#X connect 2 0 20 0;
#X connect 4 0 3 0;
#X connect 5 0 20 0;
#X connect 6 0 20 0;
#X connect 7 0 20 0;
#X connect 8 0 20 0;
#X connect 9 0 20 0;
#X connect 16 0 22 0;
#X connect 17 0 22 0;
#X connect 19 0 21 0;
#X connect 20 0 4 0;
#X connect 21 0 22 0;
#X connect 22 0 23 0;
#X connect 24 0 22 0;
#X connect 25 0 22 0;
#X connect 28 0 22 0;
#X connect 29 0 22 0;
#X connect 31 0 20 0;
#X restore 499 362 pd swap_subsym;
#N canvas 562 164 521 530 renumber(2) 0;
#X msg 108 220 dump;
#X obj 27 139 loadbang;
#X msg 126 252 renumber;
#X msg 153 307 renumber2;
#X obj 108 413 swap;
#X obj 108 440 pack;
#X obj 108 470 print Address/Data;
#X text 183 253 from 0 (default);
#X obj 108 386 cyclone/coll;
#C restore;
#X obj 177 437 print -----------:;
#X text 144 220 <= check original \, then renumber and check again;
#X text 99 37 The renumber message affects only integer addresses and lists all of them in a consecutive order starting at a given value (default 0).;
#X text 100 87 The renumber2 message also only affects integer addresses and increments all of them by one - also starting at a given value (default 0).;
#X msg 27 166 1 100 \, 2 200 \, 3 300 \, 4 400 \, 5 500 \, 6 600 \, 7 700 \, 8 800 \, 9 900 \, 10 1000;
#X msg 177 410 ::-------;
#X text 216 307 increments by 1 (from 0);
#X msg 136 275 renumber 2;
#X text 209 276 from 2;
#X msg 162 338 renumber2 8;
#X text 241 339 (from 8);
#X connect 0 0 8 0;
#X connect 1 0 13 0;
#X connect 2 0 8 0;
#X connect 3 0 8 0;
#X connect 4 0 5 0;
#X connect 4 1 5 1;
#X connect 5 0 6 0;
#X connect 8 0 4 0;
#X connect 8 1 4 1;
#X connect 8 3 14 0;
#X connect 13 0 8 0;
#X connect 14 0 9 0;
#X connect 16 0 8 0;
#X connect 18 0 8 0;
#X restore 499 383 pd renumber(2);
#N canvas 533 152 456 357 separate 0;
#X text 28 20 Given an int address as the argument \, the separate message increments numeric addresses equal and above it. Thus \, it creates an open slot or a separation in the data collection.;
#X obj 128 220 cyclone/coll;
#C restore;
#X obj 128 85 loadbang;
#X msg 128 111 0 0 \, 1 1 \, 2 2 \, 3 3 \, 4 4 \, 5 5;
#X msg 177 177 separate 3;
#X msg 153 145 dump;
#X obj 128 252 swap;
#X obj 128 279 pack;
#X obj 128 309 print Address/Data;
#X obj 197 276 print -----------:;
#X msg 197 249 ::-----;
#X text 252 176 addresses;
#X connect 1 0 6 0;
#X connect 1 1 6 1;
#X connect 1 3 10 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 7 0;
#X connect 6 1 7 1;
#X connect 7 0 8 0;
#X connect 10 0 9 0;
#X restore 517 404 pd separate;
#N canvas 513 190 808 419 min_max 0;
#X msg 164 184 max;
#X msg 154 160 min;
#X msg 199 245 max 2;
#X obj 103 342 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 103 130 1 10 100 1000 \, 2 20 200 2000 \, 3 30 300 3000;
#X obj 103 104 loadbang;
#X text 239 245 <= 2nd element;
#X text 203 172 <= 1st element (same as;
#X text 234 186 "min 1" / "max 1");
#X msg 183 222 min 3;
#X text 225 222 <= 3rd element;
#X obj 126 317 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 39 218 length;
#X text 34 372 The length message outputs the number of entries/addresses in the collection to the left outlet.;
#X obj 564 296 cyclone/coll;
#C restore;
#X obj 103 290 cyclone/coll;
#C restore;
#X obj 509 74 loadbang;
#X msg 564 365 F;
#X obj 564 337 cyclone/prepend set;
#X msg 509 100 store A 0 1 2 3 4 5 \, store 1 A B C D E F;
#X obj 636 186 hradio 15 1 0 6 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X floatatom 636 232 3 0 0 0 - - - 0;
#X msg 636 254 nth 1 \$1;
#X obj 636 208 + 1;
#X obj 564 154 hradio 15 1 0 6 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X floatatom 564 200 3 0 0 0 - - - 0;
#X obj 564 176 + 1;
#X msg 564 222 nth A \$1;
#X text 594 364 <= nth;
#X text 168 316 <= address of min/max value;
#X text 166 341 <= min/max value;
#X text 29 10 The 'min' and 'max' messages can find the lowest and highest numerical value of a given element in the list (starting from 1 \, the default). The min/max value comes out the left outlet and the address on the 2nd outlet.;
#X text 424 16 The nth message specifies an address and an element number (startng at 1). This element is then output to the left outlet.;
#X connect 0 0 15 0;
#X connect 1 0 15 0;
#X connect 2 0 15 0;
#X connect 4 0 15 0;
#X connect 5 0 4 0;
#X connect 9 0 15 0;
#X connect 12 0 15 0;
#X connect 14 0 18 0;
#X connect 15 0 3 0;
#X connect 15 1 11 0;
#X connect 16 0 19 0;
#X connect 18 0 17 0;
#X connect 19 0 14 0;
#X connect 20 0 23 0;
#X connect 21 0 22 0;
#X connect 22 0 14 0;
#X connect 23 0 21 0;
#X connect 24 0 26 0;
#X connect 25 0 27 0;
#X connect 26 0 25 0;
#X connect 27 0 14 0;
#X restore 517 460 pd min_max \; length \; nth;
#N canvas 380 159 940 457 merge 0;
#X msg 42 143 1 one;
#X msg 109 107 merge 1 two three;
#X text 66 24 The merge message appends any message to an address. The address is the first argument (an int or symbol) and the remaining elements is the message to append - if the address doesn't exist \, merge creates the address with that message.;
#X obj 42 118 loadbang;
#X obj 109 285 cyclone/prepend set;
#X msg 163 208 1;
#X msg 159 185 one;
#X msg 123 152 merge one 1 2 3;
#X text 226 153 creates address "one" if not existing;
#X text 220 107 appends "two three" after "one" in address 1;
#X text 196 197 <= addresses;
#X text 48 342 data =>;
#X obj 109 252 cyclone/coll;
#C restore;
#X obj 542 154 loadbang;
#X msg 645 215 sub 0 3 three;
#X obj 622 287 cyclone/prepend set;
#X msg 635 180 nsub 0 3 três;
#X msg 622 153 0;
#X text 527 23 You can substitute a particular element in a message with the "sub" and "nsub" messages. The first argument is the address (an int or symbol) the second is the element number and the third is the element to substitute to.;
#X text 528 85 The difference is that "sub" automatically outputs the substituted message \, while "nsub" doesn't.;
#X msg 542 179 0 1 2 3 4 5;
#X text 653 154 output message;
#X text 726 181 substitute without output;
#X text 733 216 outputs automatically;
#X obj 622 254 cyclone/coll;
#C restore;
#X obj 109 369 print merge;
#X obj 109 307 t b a;
#X text 561 352 data =>;
#X obj 622 379 print merge;
#X obj 622 317 t b a;
#X msg 109 340;
#X msg 622 350;
#X connect 0 0 12 0;
#X connect 1 0 12 0;
#X connect 3 0 0 0;
#X connect 4 0 26 0;
#X connect 5 0 12 0;
#X connect 6 0 12 0;
#X connect 7 0 12 0;
#X connect 12 0 4 0;
#X connect 13 0 20 0;
#X connect 14 0 24 0;
#X connect 15 0 29 0;
#X connect 16 0 24 0;
#X connect 17 0 24 0;
#X connect 20 0 24 0;
#X connect 24 0 15 0;
#X connect 26 0 30 0;
#X connect 26 1 30 0;
#X connect 29 0 31 0;
#X connect 29 1 31 0;
#X connect 30 0 25 0;
#X connect 31 0 28 0;
#X restore 526 315 pd merge \; sub/nsub;
#X obj 158 279 nbx 2 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 246 145 loadbang;
#X obj 56 148 hradio 15 1 0 5 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0;
#X obj 56 169 nbx 2 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 135 232 cyclone/coll;
#C restore;
#X obj 74 383 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 119 383 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 164 383 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 209 383 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 74 355 route float list symbol;
#X text 69 401 float;
#X text 116 401 list;
#X text 160 401 symbol;
#X text 205 401 anything;
#X obj 135 322 print coll_data;
#N canvas 510 65 957 457 store/remove 0;
#X obj 53 154 loadbang;
#X obj 53 214 cyclone/coll;
#C restore;
#X obj 53 264 nbx 2 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 53 180 store -1 23 \, -1;
#X text 100 239 address;
#X obj 199 341 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 224 191 symbol gain;
#X symbolatom 222 316 6 0 0 0 - - - 0;
#X floatatom 76 240 3 0 0 0 - - - 0;
#X text 88 265 data;
#X msg 241 237 symbol freq;
#X text 228 172 addresses:;
#X text 247 341 data;
#X obj 173 245 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 199 291 cyclone/coll;
#C restore;
#X obj 601 76 loadbang;
#X msg 561 164 dump;
#X obj 601 280 cyclone/coll;
#C restore;
#X msg 643 183 remove note;
#X text 446 31 To remove a data message from [coll] \, use the remove message. It removes the address specified by an int/symbol along with its data.;
#X msg 601 101 store 1 0.1 \, 2 3 \, store velocity 127 \, store note 60;
#X msg 629 159 remove 1;
#X obj 601 332 print coll_data;
#X obj 624 306 print coll_address;
#X msg 233 212 gain;
#X msg 253 260 freq;
#X msg 677 214 1;
#X msg 684 241 note;
#X text 467 379 If you send it an address that doesn't exist or has been removed \, the coll object will not output anything or respond in any way.;
#X text 43 26 You can use the "store" message to store data at a given symbol address. You can also use it for int addresses \, but it is not needed as you can just use a list that starts with an integer for that. Note that storing to an existing address updates it!;
#X obj 199 100 loadbang;
#X msg 199 125 store gain 0.5 \, store freq 440;
#X text 266 212 works without the symbol selector *;
#X text 42 376 * The symbol address input has an optional symbol selector \, but it's always output as a symbol message with the symbol selector.;
#X text 267 316 <= address *;
#X connect 0 0 3 0;
#X connect 1 0 2 0;
#X connect 1 1 8 0;
#X connect 3 0 1 0;
#X connect 6 0 14 0;
#X connect 10 0 14 0;
#X connect 13 0 14 0;
#X connect 14 0 5 0;
#X connect 14 1 7 0;
#X connect 15 0 20 0;
#X connect 16 0 17 0;
#X connect 17 0 22 0;
#X connect 17 1 23 0;
#X connect 18 0 17 0;
#X connect 20 0 17 0;
#X connect 21 0 17 0;
#X connect 24 0 14 0;
#X connect 25 0 14 0;
#X connect 26 0 17 0;
#X connect 27 0 17 0;
#X connect 30 0 31 0;
#X connect 31 0 14 0;
#X restore 490 212 pd store/remove;
#X text 386 361 change addresses:;
#X text 406 213 change data:;
#N canvas 546 50 820 455 insert(2) 0;
#X obj 120 115 loadbang;
#X obj 189 373 print Address/Data;
#X msg 138 180 dump;
#X obj 115 323 cyclone/join @triggers 1;
#X obj 120 278 cyclone/coll;
#C restore;
#X msg 189 347 =====;
#X obj 518 142 loadbang;
#X obj 587 400 print Address/Data;
#X msg 536 207 dump;
#X obj 514 350 cyclone/join @triggers 1;
#X msg 587 377 =====;
#X msg 518 173 0 0 \, 5 5 \, 10 10 \, 15 15;
#X msg 120 145 0 0 \, 1 1 \, 2 2 \, 3 3 \, 4 4 \, 5 5;
#X msg 557 269 insert2 3 three;
#X text 416 67 The insert2 message is the same as insert \, but in this case it doesn't shift addresses up (so it only does it if it has to include an existing address).;
#X msg 180 239 store 4 Four;
#X text 264 240 *;
#X text 50 414 * Note that storing an existing address only updates it!;
#X text 24 15 The insert message is only for int addresses! It inserts a new int address and increments all addresses equal or greater than it by 1 - this allows the address to be inserted even if that address was already in the collection (since it is now shifted up).;
#X text 415 15 You can also insert an address that's not in the collection. In this case \, the "insert" message will still increment addresses that are greater by!;
#X obj 518 305 cyclone/coll;
#C restore;
#X msg 149 210 insert 2 two;
#X msg 548 237 insert 8 eight;
#X connect 0 0 12 0;
#X connect 2 0 4 0;
#X connect 3 0 1 0;
#X connect 4 0 3 1;
#X connect 4 1 3 0;
#X connect 4 3 5 0;
#X connect 5 0 1 0;
#X connect 6 0 11 0;
#X connect 8 0 20 0;
#X connect 9 0 7 0;
#X connect 10 0 7 0;
#X connect 11 0 20 0;
#X connect 12 0 4 0;
#X connect 13 0 20 0;
#X connect 15 0 4 0;
#X connect 20 0 9 1;
#X connect 20 1 9 0;
#X connect 20 3 10 0;
#X connect 21 0 4 0;
#X connect 22 0 20 0;
#X restore 508 271 pd insert(2);
#N canvas 682 97 433 416 delete 0;
#X obj 144 141 loadbang;
#X msg 102 192 dump;
#X obj 144 274 cyclone/coll;
#C restore;
#X msg 173 206 delete 2;
#X msg 56 193 clear;
#X msg 144 172 0 0 \, 1 1 \, 2 2 \, 3 3 \, 4 4 \, 5 5 \, store six 6;
#X obj 213 364 print Address/Data;
#X msg 213 321 =====;
#X obj 98 304 list prepend;
#X obj 98 327 list trim;
#X msg 176 237 delete six;
#X text 46 25 The delete message removes an int address and decrements all addresses equal or greater than it by 1 - this prevents from leaving an open slot \, as it is the case with the "remove" message.;
#X text 47 91 The delete message can also remove a symbol address - in this case it acts in the same way as "remove".;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 2 0 8 0;
#X connect 2 1 8 1;
#X connect 2 3 7 0;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X connect 5 0 2 0;
#X connect 7 0 6 0;
#X connect 8 0 9 0;
#X connect 9 0 6 0;
#X connect 10 0 2 0;
#X restore 526 293 pd delete;
#N canvas 569 116 463 285 refer 0;
#X msg 158 78 dump;
#X obj 207 207 print address;
#X obj 184 232 print value;
#X msg 184 109 refer example1;
#X msg 209 143 refer coll.txt;
#X obj 184 176 cyclone/coll;
#C restore;
#X text 74 15 The "refer" message can refer a [coll] object to a data collection of another [coll] object with another name or filename.;
#X connect 0 0 5 0;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X connect 5 1 1 0;
#X restore 532 154 pd refer;
#N canvas 554 71 457 654 named_coll 0;
#X obj 31 254 loadbang;
#X obj 200 316 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 245 316 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 200 230 dump;
#X obj 335 312 bng 18 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 335 336 print dump_done;
#X obj 200 373 print data/address;
#X obj 200 343 pack f f;
#X msg 218 258 clear;
#X msg 48 334 dump;
#X obj 31 413 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 76 413 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 166 409 bng 18 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 166 433 print dump_done;
#X obj 31 470 print data/address;
#X obj 31 440 pack f f;
#X obj 282 406 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 261 258 <= clear the data;
#X text 322 428 adds value;
#X text 34 29 The same collection of data can be shared and accessed or manipulated by different instances of the [coll] object if they share the same name (1st symbol argument).;
#X obj 31 380 cyclone/coll example1 1;
#C restore;
#X obj 200 286 cyclone/coll example1 1;
#C restore;
#X obj 282 465 cyclone/coll example1 1;
#C restore;
#X text 58 511 See how clearing the collection in one [coll] instance affects others with the same name - same with adding messages.;
#X msg 31 286 0 0 \, 1 1 \, 2 2 \, 3 3;
#X msg 282 433 4 \$1;
#X text 322 441 at address 4;
#X text 34 161 Below \, the [coll] in the left stores some data that can be viewed and edited by the [coll] objects in the right \, since they all have the same name ('example1').;
#X text 34 75 Note that the first argument is also for loading files \, so it also searches for a file with that name. If [coll] doesn't find the file \, the filename will still work as the name of the [coll] object. You can prevent coll from searching for a file with a non-0 value as the second argument \, which should be done if you're not loading files!;
#X text 36 562 ============================================================;
#X text 38 582 Important: A [coll] object with no name or filename argument will have its own single collection of data \, not shared amongst other [coll] objects that also have no names.;
#X connect 0 0 24 0;
#X connect 1 0 7 0;
#X connect 2 0 7 1;
#X connect 3 0 21 0;
#X connect 4 0 5 0;
#X connect 7 0 6 0;
#X connect 8 0 21 0;
#X connect 9 0 20 0;
#X connect 10 0 15 0;
#X connect 11 0 15 1;
#X connect 12 0 13 0;
#X connect 15 0 14 0;
#X connect 16 0 25 0;
#X connect 20 0 10 0;
#X connect 20 1 11 0;
#X connect 20 3 12 0;
#X connect 21 0 1 0;
#X connect 21 1 2 0;
#X connect 21 3 4 0;
#X connect 24 0 20 0;
#X connect 25 0 22 0;
#X restore 502 96 pd named_coll;
#X msg 100 172 dump;
#X msg 135 173 clear;
#X obj 158 300 print address;
#X obj 211 256 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X msg 143 198 open;
#X msg 181 198 wclose;
#X text 138 148 <== address;
#N canvas 454 189 838 370 read/write 0;
#X msg 213 207 write coll.txt;
#X msg 186 124 read coll.txt;
#X msg 81 114 next;
#X msg 98 143 prev;
#X obj 98 303 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 195 150 readagain;
#X msg 225 232 writeagain;
#X msg 166 96 read;
#X obj 139 303 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 205 181 write;
#X obj 180 301 bng 18 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 41 113 bng 18 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 60 114 or;
#X text 260 150 reopens file;
#X text 277 123 opens file;
#X text 198 96 opens dialog window to open file;
#X text 247 180 opens dialog window to save;
#X text 308 207 saves to file;
#X text 296 232 resaves to file;
#X obj 98 270 cyclone/coll coll.txt;
#C restore;
#X msg 682 199 next;
#X msg 681 174 prev;
#X obj 629 259 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 674 259 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 544 184 goto 50;
#X msg 610 159 start;
#X msg 629 183 end;
#X text 480 164 goes to address 50;
#X obj 629 229 cyclone/coll coll.txt 1;
#C restore;
#X text 456 16 The basic navigation through [coll]'s data is with the "next" (same as a bang) or "prev" messages that \, respectively \, go to the next and the previous address.;
#X text 39 28 You can also use the 1st argument to specify a filename for [coll] to load when isntantiated. The read/write messages allow you to read/write from and to other files.;
#X text 204 310 (also bangs on isntantiation);
#X obj 180 333 print done_reading;
#X text 205 294 bang when finishing read operation;
#X text 456 66 The pointer to the address is set for all [coll] objects with the same 1st argument (name or filename). So navigating in the object to the left affects the navigation of the object below. The "goto <address>" message ses the pointer to an address \, "start" goes to the first address \, "end" goes to the last one.;
#X text 457 295 Note how above there's a 2nd argument to prevent it from searching for a file because the [coll] to the left already loaded the file - since [coll] objects with the same name share data \, it doesn't need to load the file again!;
#X connect 0 0 19 0;
#X connect 1 0 19 0;
#X connect 2 0 19 0;
#X connect 3 0 19 0;
#X connect 5 0 19 0;
#X connect 6 0 19 0;
#X connect 7 0 19 0;
#X connect 9 0 19 0;
#X connect 10 0 32 0;
#X connect 11 0 19 0;
#X connect 19 0 4 0;
#X connect 19 1 8 0;
#X connect 19 2 10 0;
#X connect 20 0 28 0;
#X connect 21 0 28 0;
#X connect 24 0 28 0;
#X connect 25 0 28 0;
#X connect 26 0 28 0;
#X connect 28 0 22 0;
#X connect 28 1 23 0;
#X restore 460 118 pd read/write files \; data navigation;
#N canvas 450 160 787 431 alias 0;
#X obj 128 272 cyclone/coll;
#C restore;
#X msg 26 222 1;
#X msg 56 222 2;
#X msg 46 147 1 foo \, 2 bar;
#X msg 128 101 assoc foo 1;
#X msg 140 122 deassoc foo 1;
#X msg 154 152 assoc bar 2;
#X msg 164 173 deassoc bar 2;
#X msg 175 206 foo;
#X msg 211 206 bar;
#X text 228 121 deassociates foo & 1;
#X text 204 99 associates foo & 1;
#X text 233 151 associates bar & 2;
#X text 253 173 deassociates bar & 2;
#X text 24 17 Use "assoc" and "deassoc" to associate and deassociate a symbol alias to an int address \, so you can optionally use the symbol name address isntead of the int address.;
#X obj 46 123 loadbang;
#X msg 218 239 remove foo;
#X text 289 239 *;
#X obj 531 306 cyclone/coll;
#C restore;
#X obj 531 166 loadbang;
#X msg 561 235 one;
#X floatatom 151 300 3 0 0 0 - - - 0;
#X symbolatom 128 326 7 0 0 0 - - - 0;
#X text 125 77 click to associate / deassociate;
#X text 177 300 <= address is still an int;
#X text 255 315 not the alias;
#X text 73 324 data =>;
#X text 602 247 alias;
#X text 592 363 data;
#X text 409 44 The format in which the alias is saved inside the [coll] object is: "<int> <alias> \, <data>".;
#X msg 531 191 nstore 1 one 1.1 \, nstore two 2 2.2;
#X msg 569 262 two;
#X text 408 83 You can store an int address with an alias with the "nstore" message. The first two elements are the int address and the alias \, and they can come in any order <int \, symbol> or <symbol \, int> - the remaining element(s) set the stored data.;
#X text 614 332 address;
#X text 37 369 * Once you have an associated alias \, you can perform any operation using the alias isnteas of the int address \, such as removing the address from the collection.;
#X obj 531 364 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 554 332 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X connect 0 0 22 0;
#X connect 0 1 21 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X connect 9 0 0 0;
#X connect 15 0 3 0;
#X connect 16 0 0 0;
#X connect 18 0 35 0;
#X connect 18 1 36 0;
#X connect 19 0 30 0;
#X connect 20 0 18 0;
#X connect 30 0 18 0;
#X connect 31 0 18 0;
#X restore 525 234 pd alias \; nstore;
#X obj 204 276 print finish_dump;
#X text 24 15 In [coll] \, any message type can be stored at a particular address \, which can be either an "integer float" (positive or negative) or a symbol.;
#X text 23 64 If an input list starts with an int \, this first element is treated as an address in which the other element(s) are stored. Any message can be stored \, but single symbol atoms are stored as symbol messages.;
#X text 31 436 A dump message spits all stored data and then sends a bang in the rightmost outlet when it's done. A clear message clears all data stored in the collection.;
#X text 31 487 You can visualize and manually edit the data by clicking on the [coll] object to open its editing window - the "open" and "wclose" messages can also open/close this window. You can type in or delete data \, then close it and save it. The format for each line is: address \, data \;;
#X msg 246 176 0 0.1 \, 1 1 2 3 \, 2 list one two \, 3 symbol hi \, 4 let's go, f 15;
#X text 499 67 Examples:;
#X connect 8 0 32 0;
#X connect 9 0 44 0;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
#X connect 12 0 17 0;
#X connect 12 0 22 0;
#X connect 12 1 8 0;
#X connect 12 3 33 0;
#X connect 12 3 39 0;
#X connect 17 0 13 0;
#X connect 17 1 14 0;
#X connect 17 2 15 0;
#X connect 17 3 16 0;
#X connect 30 0 12 0;
#X connect 31 0 12 0;
#X connect 34 0 12 0;
#X connect 35 0 12 0;
#X connect 44 0 12 0;
#X restore 482 209 pd details;
#X text 165 384 -;
#X text 180 402 1st element is an int address to store remaining data to;
#N canvas 408 115 810 540 threaded 0;
#X obj 63 200 osc~ 440;
#X obj 193 142 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 343 245 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 286 246 finished;
#X text 220 143 2) click and check;
#X text 25 165 1) raise the volume;
#X obj 220 282 timer;
#X obj 220 306 nbx 6 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 289 298 time in ms it took;
#X text 292 314 to read the file;
#X msg 558 152 threaded \$1;
#X obj 558 122 tgl 20 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 507 115 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 430 472 Users of Pd-l2ork and cyclone 0.2 beta1/beta2 that were using this extra argument for the threaded feature must now adapt their patches.;
#X text 41 354 ============================================================;
#X text 404 354 ============================================================;
#X text 18 91 Below \, [coll] loads 300 thousand entries from a file \, which would cause an audio drop out if not in threaded mode.;
#N canvas 676 50 503 504 depth-first 0;
#X msg 48 150 threaded \$1;
#X obj 48 122 tgl 20 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 144 85 bng 25 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 286 243 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X msg 286 278 2;
#X obj 286 332 print;
#X obj 144 151 trigger bang anything bang;
#X obj 363 243 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 144 243 bng 15 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 173 90 <= click and check the printed order;
#X text 42 102 try in both;
#X text 78 122 modes;
#X text 61 17 Unthreaded mode always provide the depth first behaviour \, meaning that the print order below is "1 \, 2 \, 3". The threaded mode breaks it for the read and dump operations \, printing: "1 \, 3 \, 2" isntead.;
#X obj 160 201 cyclone/coll depth 1 @threaded 0;
#C restore;
#X text 77 370 One way or another \, if an action is needed right after reading or dumping \, you should use and rely on the bangs from the outlets \, which are there for this reason and is the best practice for [coll] in any case.;
#X text 77 436 For old patches that used [trigger] isntead of the best practice \, it is encouraged that they are adapted to use the 3rd/4th outlets now and not the "threaded 0" attribute.;
#X msg 144 122 read coll_big.txt;
#X msg 144 278 3;
#X msg 363 276 ===== \, 1;
#X connect 0 0 13 0;
#X connect 1 0 0 0;
#X connect 2 0 16 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 6 0 8 0;
#X connect 6 1 13 0;
#X connect 6 2 7 0;
#X connect 7 0 18 0;
#X connect 8 0 17 0;
#X connect 13 2 3 0;
#X connect 16 0 6 0;
#X connect 17 0 5 0;
#X connect 18 0 5 0;
#X restore 677 321 pd depth-first;
#X text 441 265 An important difference is that the threaded version breaks the depth first rule \, while unthreaded keeps it (but at the cost of causing potential audio drop outs).;
#X text 442 321 Check the subpatch for more info ===>;
#X msg 507 145 dump;
#X obj 744 216 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 688 219 finished;
#X msg 380 187 threaded \$1;
#X obj 380 157 tgl 20 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X text 377 137 try in both;
#X text 413 154 modes;
#X text 422 12 The old unthreaded behaviour is still offered as an extra attribute ("@threaded 1" (default) for threaded and "@threaded 0" for unthreaded behaviour) or message. Check it in both modes below and see below how now the unthreaded mode freezes the DSP.;
#X msg 233 180 read coll_big.txt;
#X obj 233 219 cyclone/coll threaded_test 1;
#C restore;
#X obj 507 180 cyclone/coll threaded_test 1 @threaded 0;
#C restore;
#X obj 193 197 t b b;
#X text 18 15 From cyclone 0.3-alpha1 \, [coll] is threaded by default. This allows the read operation to run in a separate thread \, preventing audio drop outs as in Max! This also means you have to rely on the bang from the 3rd outlets to know the operation has been completed.;
#X text 504 92 Note that the dump feature is not threaded!;
#X text 47 462 This extra argument raised a conflict with the 2nd argument that was introduced to [coll] in Max 4.0.8 \, which wasn't present in cyclone's [coll] because it was first cloned from the Max version 4.0!;
#X text 428 397 Cyclone 0.3 did update all objects to Max 7 \, so [coll]'s 2nd argument was included \, amongst other things. Now we don't have the threaded functionality as an argument \, but as an attribute as shown above. Another change \, already mentioned \, is that the threaded functionality is now the default.;
#X text 47 409 Cyclone 0.2 beta1/beta2 included Pd-l2ork's [coll] version \, which had an extra float argument (0/1) to define the threaded mode (which was "0" - unthreaded - by default). Cyclone 0.2 beta 3 removed this threaded functionality., f 60;
#X obj 63 245 output~;
#X text 46 381 Backwards compatibility;
#X obj 59 323 declare -stdpath ./;
#X connect 0 0 37 0;
#X connect 1 0 31 0;
#X connect 2 0 6 1;
#X connect 6 0 7 0;
#X connect 10 0 30 0;
#X connect 11 0 10 0;
#X connect 12 0 20 0;
#X connect 20 0 30 0;
#X connect 23 0 29 0;
#X connect 24 0 23 0;
#X connect 28 0 29 0;
#X connect 29 2 2 0;
#X connect 30 3 21 0;
#X connect 31 0 28 0;
#X connect 31 1 6 0;
#X restore 463 233 pd threaded \; & backwards \; compatibility;
#X text 82 384 float/symbol;
#X text 180 385 an "int float" or "symbol" address: outputs the stored data;
#X text 178 470 - integer or symbol address of the stored message;
#X text 98 470 float/symbol;
#X text 189 539 name or filename to load (same name colls share contents);
#X text 178 488 - when finishing a read operation;
#X obj 3 6 ./header coll;
#X text 21 59 Store/edit message collections;
#X text 122 318 see also:;
#X obj 191 318 text;
#X text 228 319 from Vanilla as an alternative;
#X connect 21 0 46 0;
#X connect 29 0 46 0;
#X connect 39 0 46 0;
#X connect 40 0 46 0;
#X connect 46 0 22 0;
#X connect 46 1 23 0;
