#N canvas 619 183 687 414 12;
#X obj 70 12 threshold~;
#X obj 52 178 sig~;
#X obj 52 273 threshold~ 10 100 0 100;
#X text 241 272 Arguments:;
#X text 322 272 1 trigger threshold;
#X floatatom 52 151 5 0 0 0 - - - 0;
#X obj 52 334 print trigger;
#X obj 210 334 print rest;
#X text 323 288 2 trigger debounce time;
#X text 323 305 3 rest threshold;
#X text 322 320 4 rest debounce time;
#X text 443 368 updated for Pd version 0.32;
#X msg 177 231 1;
#X msg 210 231 0;
#X text 57 50 threshold~ monitors its input signal and outputs bangs
when the signal exceeds a specified "trigger" value \, and also when
the signal recedes below a "rest" value. You can specify debounce times
in milliseconds \, for the threshold~ to wait after the two event types
before triggering again.;
#X msg 111 170 set 0 2000 1 2000;
#X msg 119 196 set 10 100 0 100;
#X text 239 170 "set" to change the parameters;
#X text 248 228 zero or nonzero in inlet to set the state to "high"
or "low". There is no debounce period after this.;
#X text 161 11 - trigger from audio signal;
#X msg 516 124 \; pd dsp \$1;
#X obj 516 93 tgl 16 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 0 1;
#X text 538 92 DSP on/off;
#X obj 52 303 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 210 303 bng 17 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X connect 1 0 2 0;
#X connect 2 0 23 0;
#X connect 2 1 24 0;
#X connect 5 0 1 0;
#X connect 12 0 2 1;
#X connect 13 0 2 1;
#X connect 15 0 2 0;
#X connect 16 0 2 0;
#X connect 21 0 20 0;
#X connect 23 0 6 0;
#X connect 24 0 7 0;
