#N canvas 534 29 563 605 10;
#X declare -stdpath ./;
#X obj 2 362 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 479 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 541 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 84 371 cnv 17 3 76 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 453 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X floatatom 166 209 5 0 0 0 - - - 0;
#X floatatom 229 210 5 0 0 0 - - - 0;
#X obj 84 488 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 84 511 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 154 234 cyclone/flush;
#X obj 2 572 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X text 158 372 -;
#X text 125 372 bang;
#X text 158 393 -;
#X text 118 393 float;
#X text 158 414 -;
#X text 124 414 list;
#X text 158 435 -;
#X text 158 455 -;
#X text 118 455 float;
#X text 158 490 -;
#X text 118 490 float;
#X text 158 513 -;
#X text 118 513 float;
#X text 191 550 (none);
#X text 67 86 Like a "panic button" \, [flush] keeps track of Note-on messages that weren't switched off and "flushes" them by sending corresponding note-offs when it receives a bang.;
#X obj 117 181 bng 18 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X text 173 414 sets a pitch/velocity pair of a note message, f 60;
#X text 173 435 clears the hanging notes that [flush] keeps track off;
#X text 173 372 sends note off for hanging notes, f 60;
#X text 118 435 clear;
#X text 173 455 sets the velocity part of the note message, f 60;
#X text 173 393 sets the pitch part of the note message, f 60;
#X text 173 490 the pitch part of a note message, f 60;
#X text 173 513 the velocity part of a note message, f 60;
#X obj 229 259 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 154 259 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 279 259 velocity;
#X text 112 259 pitch;
#X text 48 182 flush them;
#X msg 154 158 64 100 \, 69 100;
#X text 249 158 and leave them hanging;
#X text 153 138 send a couple of note on messages;
#X obj 229 278 print velocity;
#X obj 154 279 print pitch;
#X text 166 190 pitch;
#X text 225 190 velocity;
#N canvas 650 23 470 626 example 0;
#X obj 93 159 cnv 15 140 40 empty empty empty 20 12 0 14 #ececec #404040 0;
#N canvas 923 225 443 345 polysynth 0;
#X obj 85 63 inlet;
#X obj 173 298 outlet~;
#N canvas 292 354 342 369 voice 0;
#X obj 197 123 / 127;
#X obj 182 228 *~;
#X obj 182 260 *~ 0.2;
#X obj 92 149 phasor~;
#X obj 92 117 mtof;
#X obj 92 42 inlet;
#X obj 182 297 outlet~;
#X obj 197 183 line~;
#X msg 197 148 \$1 250;
#X obj 49 184 cyclone/triangle~ 0.7;
#X obj 92 83 unpack float float;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 5 0 10 0;
#X connect 7 0 1 1;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 4 0;
#X connect 10 1 0 0;
#X restore 24 209 pd voice;
#N canvas 292 354 342 369 voice 0;
#X obj 197 123 / 127;
#X obj 182 228 *~;
#X obj 182 260 *~ 0.2;
#X obj 92 149 phasor~;
#X obj 92 117 mtof;
#X obj 92 42 inlet;
#X obj 182 297 outlet~;
#X obj 197 183 line~;
#X msg 197 148 \$1 250;
#X obj 49 184 cyclone/triangle~ 0.7;
#X obj 92 83 unpack float float;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 5 0 10 0;
#X connect 7 0 1 1;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 4 0;
#X connect 10 1 0 0;
#X restore 87 209 pd voice;
#N canvas 292 354 342 369 voice 0;
#X obj 197 123 / 127;
#X obj 182 228 *~;
#X obj 182 260 *~ 0.2;
#X obj 92 149 phasor~;
#X obj 92 117 mtof;
#X obj 92 42 inlet;
#X obj 182 297 outlet~;
#X obj 197 183 line~;
#X msg 197 148 \$1 250;
#X obj 49 184 cyclone/triangle~ 0.7;
#X obj 92 83 unpack float float;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 5 0 10 0;
#X connect 7 0 1 1;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 4 0;
#X connect 10 1 0 0;
#X restore 154 209 pd voice;
#N canvas 292 354 342 369 voice 0;
#X obj 197 123 / 127;
#X obj 182 228 *~;
#X obj 182 260 *~ 0.2;
#X obj 92 149 phasor~;
#X obj 92 117 mtof;
#X obj 92 42 inlet;
#X obj 182 297 outlet~;
#X obj 197 183 line~;
#X msg 197 148 \$1 250;
#X obj 49 184 cyclone/triangle~ 0.7;
#X obj 92 83 unpack float float;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 5 0 10 0;
#X connect 7 0 1 1;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 4 0;
#X connect 10 1 0 0;
#X restore 217 209 pd voice;
#N canvas 292 354 342 369 voice 0;
#X obj 197 123 / 127;
#X obj 182 228 *~;
#X obj 182 260 *~ 0.2;
#X obj 92 149 phasor~;
#X obj 92 117 mtof;
#X obj 92 42 inlet;
#X obj 182 297 outlet~;
#X obj 197 183 line~;
#X msg 197 148 \$1 250;
#X obj 49 184 cyclone/triangle~ 0.7;
#X obj 92 83 unpack float float;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 5 0 10 0;
#X connect 7 0 1 1;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 4 0;
#X connect 10 1 0 0;
#X restore 284 209 pd voice;
#N canvas 292 354 342 369 voice 0;
#X obj 197 123 / 127;
#X obj 182 228 *~;
#X obj 182 260 *~ 0.2;
#X obj 92 149 phasor~;
#X obj 92 117 mtof;
#X obj 92 42 inlet;
#X obj 182 297 outlet~;
#X obj 197 183 line~;
#X msg 197 148 \$1 250;
#X obj 49 184 cyclone/triangle~ 0.7;
#X obj 92 83 unpack float float;
#X connect 0 0 8 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 5 0 10 0;
#X connect 7 0 1 1;
#X connect 8 0 7 0;
#X connect 9 0 1 0;
#X connect 10 0 4 0;
#X connect 10 1 0 0;
#X restore 347 209 pd voice;
#X obj 85 97 poly 6 1;
#X obj 130 63 inlet;
#X obj 85 166 route 1 2 3 4 5 6, f 38;
#X obj 85 136 pack f f f;
#X connect 0 0 8 0;
#X connect 2 0 1 0;
#X connect 3 0 1 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 1 0;
#X connect 7 0 1 0;
#X connect 8 0 11 0;
#X connect 8 1 11 1;
#X connect 8 2 11 2;
#X connect 9 0 8 1;
#X connect 10 0 2 0;
#X connect 10 1 3 0;
#X connect 10 2 4 0;
#X connect 10 3 5 0;
#X connect 10 4 6 0;
#X connect 10 5 7 0;
#X connect 11 0 10 0;
#X restore 119 238 pd polysynth;
#X obj 235 235 cyclone/borax;
#X obj 64 114 bng 30 250 50 0 empty empty empty 17 7 0 10 #d0d0d0 #686868 #000000;
#X obj 113 26 bng 17 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 253 286 nbx 3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 26 113 Flush them off, f 5;
#X obj 113 51 expr random(50 \, 80);
#X obj 113 172 cyclone/flush;
#X obj 113 112 stripnote;
#X obj 113 81 makenote 100 500;
#X text 179 108 filter out note off \; leave notes hanging;
#X text 142 25 generate random note messages;
#X obj 119 287 output~;
#X text 300 278 number of played notes, f 12;
#X obj 275 172 declare -stdpath ./;
#X obj 149 463 poly;
#X msg 149 430 stop;
#X text 187 431 flush hanging note on messages;
#X text 44 374 Note \, however \, that if you're using [poly] (as in the [pd polysynth] abstraction above) \, you can use the "flush" message.;
#X obj 302 569 open-else;
#X text 301 474 click;
#X text 86 515 Plugdata users or those with ELSE may also be using objects that also have built in 'flush' options \, such as [else/voices] \, [else/midi] and [else/keyboard]., f 32;
#X msg 302 493 voices;
#X msg 313 518 midi;
#X msg 323 542 keyboard;
#X connect 1 0 13 0;
#X connect 2 2 5 0;
#X connect 3 0 8 0;
#X connect 4 0 7 0;
#X connect 7 0 10 0;
#X connect 8 0 2 0;
#X connect 8 0 1 0;
#X connect 8 1 2 1;
#X connect 8 1 1 1;
#X connect 9 0 8 0;
#X connect 9 1 8 1;
#X connect 10 0 9 0;
#X connect 10 1 9 1;
#X connect 17 0 16 0;
#X connect 23 0 20 0;
#X connect 24 0 20 0;
#X connect 25 0 20 0;
#X restore 470 265 pd example;
#X obj 3 5 ./header flush;
#X text 22 61 Flush hanging note-ons;
#X obj 212 322 cyclone/midiflush;
#X text 138 321 see also:;
#X obj 334 322 bag;
#X connect 5 0 9 0;
#X connect 6 0 9 1;
#X connect 9 0 36 0;
#X connect 9 1 35 0;
#X connect 26 0 9 0;
#X connect 35 0 43 0;
#X connect 36 0 44 0;
#X connect 40 0 9 0;
