Forums > MaxMSP

### Acknowledging a sudden increase

Jun 21 2013 | 9:24 am

Hi

This is a difficult to explain but basically I have a numerical output which is always changing. However, I dont want to acknowledge the small changes in numbers, but only when the numbers increase quickly and a large increase of numbers.

If anyone has any ideas if this is possible, id appreciate the time,

J

Jun 21 2013 | 9:36 am

it really depends on if we are talking about consecutive numbers, about a certain time period, or about a tendency, the latter which would require that the user may (and have to) set the time and difference values arbitrarily.

for consecutive numbers, something like [if abs(\$f1-\$f2)>=50 then 1 else 0], where \$f2 is the last value, will be all you need.

if time is involved, [timer], and probably [accum] and [mean] should be created in your patch now as a precaution. ;)

-110

Jun 21 2013 | 1:31 pm

I don’t really know which of those options my situation fits into sorry.

If this helps, the numbers are the y corridents produced by blob tracking. So as you can imagine the numbers are constantly changing…

However, what I want to do is create a way of making the patch understand when those numbers rise or fall is over a particular range at a particular speed

I can’t quite get my head round that at the minute. Does it need to be something like, if a change over e.g 10 happens within 50ms then bang? does that make sense?

Jun 21 2013 | 4:17 pm

"Does it need to be something like, if a change over e.g 10 happens within 50ms then bang? does that make sense?"

yes, of course. just calculate a "velocity" value from these time and difference values, then work on that.

Jun 22 2013 | 4:41 am

Hi
here’s a Max solution (as opposed to a Maths solution); using [trigger], [pipe] and [-] to give you velocity. You will need to tweak a few parameters, as Roman states, to get the desired result.

```<code>
-- Pasted Max  Patch, click to expand. --

</code>
There is a related thread here:
http://cycling74.com/forums/topic/simple-problem-detect-peaks-troughs-in-sine-wave-in-max-not-msp/
Brendan
```
Jun 22 2013 | 5:01 am

Wow, that is brilliant. Needs a bit of tweaking to fit my patch but that is spot on. Thanks

J

Jun 22 2013 | 5:17 am

:)
this forum is brilliant

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

Forums > MaxMSP