#N canvas 588 23 509 442 12;
#X msg 68 237 60 64;
#X msg 117 237 60 0;
#X msg 161 237 62 64;
#X msg 209 237 62 0;
#X text 236 355 Output is in the printout window.;
#X msg 224 287 clear;
#X msg 217 262 flush;
#X text 27 154 The collection may have many copies of the same value. You can output the collection (and empty it) with a "flush" message \, or just empty it with "clear." You can use this to mimic a sustain pedal \, for example., f 66;
#X obj 161 354 print bag;
#X obj 161 324 bag;
#X text 15 408 see also:;
#X obj 136 409 makenote;
#X obj 24 16 bag;
#X obj 92 409 poly;
#X text 287 408 updated for Pd version 0.33;
#N canvas 666 144 576 286 reference 0;
#X obj 8 42 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0;
#X obj 8 75 cnv 1 550 1 empty empty 1st: 8 12 0 13 #9f9f9f #000000 0;
#X obj 8 188 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 8 225 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 7 259 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 8 149 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0;
#X text 106 84 float -;
#X obj 28 12 bag;
#X text 60 11 - collection of numbers;
#X text 106 104 flush -;
#X text 106 123 clear -;
#X text 108 160 float - flag: true (nonzero) or false (zero)., f 57;
#X text 107 198 float - the stored values on flush message., f 49;
#X text 126 232 NONE;
#X text 163 123 clear stored values from the bag (no output).;
#X text 163 104 output stored values and clear the bag.;
#X text 163 84 value to store or delete depending on the flag.;
#X restore 330 16 pd reference;
#X text 428 15 <= click;
#X obj 9 49 cnv 1 490 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 9 394 cnv 1 490 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 27 62 The [bag] object adds a value to or removes it from a collection of numbers depending on the flag. The left inlet takes the value and the right inlet takes the flag. If the flag is true (nonzero) \, the value is added to the collection and removed otherwise. The example here takes a list input \, which gets spread at inlets (as is common in Pd)., f 66;
#X text 247 237 <-- add or delete elements;
#X text 261 262 <-- output them;
#X text 269 287 <-- start over;
#X text 57 16 - collection of numbers;
#X connect 0 0 9 0;
#X connect 1 0 9 0;
#X connect 2 0 9 0;
#X connect 3 0 9 0;
#X connect 5 0 9 0;
#X connect 6 0 9 0;
#X connect 9 0 8 0;
