Forums > MaxMSP

timed threshold

June 26, 2006 | 2:08 pm

hi

This may seem an obvious one, but I need to report on and trigger from a rapidly changing float every time it (only) rises above a certain threshold from 0 value (max value 1) within a certain time. can I use thresh or peak or quickthresh or line or something like that?


June 28, 2006 | 1:16 am

Not sure I’ve got a handle on this completely, but I’d try something like…

- start a timer when your signal drops below the threshold (or hits zero, etc.)
- stop the timer when your signal rises above the threshold
- evaluate the elapsed time and act if it’s short enough.

Almost every time I play with data and thresholds I go in search of Eric Singer’s(?) hysteresis object. You might find it helpful, too.

Good Luck.


June 28, 2006 | 4:02 pm

Richard Warp wrote:
> This may seem an obvious one, but I need to report on and trigger
> from a rapidly changing float every time it (only) rises above a
> certain threshold from 0 value (max value 1) within a certain time.
> can I use thresh or peak or quickthresh or line or something like
> that?

What about this?

#P button 55 201 15 0;
#P window setfont "Sans Serif" 9.;
#P number 179 124 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 55 124 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 117 124 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vpatcher 20 74 323 410;
#P window setfont "Sans Serif" 9.;
#P newex 56 227 50 196617 sel 1;
#P outlet 56 248 15 0;
#P inlet 141 73 15 0;
#P inlet 124 73 15 0;
#P window linecount 1;
#P newex 56 205 95 196617 < 100;
#P newex 56 183 50 196617 timer;
#P newex 96 161 38 196617 sel 1;
#P newex 56 161 38 196617 sel 1;
#P newex 96 139 38 196617 change;
#P newex 56 139 38 196617 change;
#P inlet 56 73 15 0;
#P newex 96 117 38 196617 > 1.;
#P newex 56 117 38 196617 > 0.;
#P connect 2 0 0 0;
#P connect 0 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 12 0;
#P connect 12 0 11 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 7 1;
#P connect 9 0 1 1;
#P connect 10 0 8 1;
#P pop;
#P newobj 55 152 134 196617 p timed threshold;
#P connect 0 0 4 0;
#P connect 3 0 0 2;
#P connect 2 0 0 0;
#P connect 1 0 0 1;
#P window clipboard copycount 5;


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


Viewing 3 posts - 1 through 3 (of 3 total)