Opposite of 'past' object?

joao's icon

Hi all,

I need to send a bang when a number is reached in a descending run of numbers. Like 'past' bangs from low to high, but opposite.

I can't seem to find something like that.

'select' doesn't respond quickly enough. '

Thanks!

big_pause's icon
Max Patch
Copy patch and select New From Clipboard in Max.

can you not just use past, with num*-1 and take you number away from 0, i.e. if the threshold is 40

dapinsker's icon

You can also use a scale object to mirror the stream of numbers.

Marc P.

3766.InversePast.maxpat
Max Patch
brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Simplest way I know is:Brendan

Wetterberg's icon

>select' doesn't respond quickly enough

Damn, how fast are you transmitting data here? I'd like to see the patch in question.

joao's icon

Thanks guys! Three great options.

@Wetterberg: I'm using cv.jit.mass for motion tracking. It might be that cv.jit.mass isn't putting out every number?

Medd's icon

I found this knocking about in my 'downloaded help' folder. I can't remember who to give credit to for this, it's a [js] solution.

3767.reversepast.js
js
Emerson's icon

(Refreshing memories :)
Hello, the one to be given credit for that [js] solution would be me; it originated in this topic:

Though being an ultra-short routine, it still had redundant code to be simplified, that escaped my attention in my earlier posts to the topic above.

The recent version can be found in the zip attachment I posted to the topic below:

Best

Christopher Dobrian's icon
Emerson's icon

Could you rephrase your question please?

EDIT: I think you were referring to an object (?)

Emerson's icon

Yes, you were... :)
[trough] seems to be the opposite of [peak], and does not seem to function as the opposite of [past], because -besides outputting different things- (the doc means that) it continuously updates the "threshold", but a constant one is needed in this case...
... I think.

Christopher Dobrian's icon

You're right. I was responding off the top of my head without reading very carefully or giving it much thought (which was not a great idea), and you're correct that trough is the opposite of peak, not past. I like big_pause's solution, which is economical and seems pretty problem-free.