When value stop - how to know it's momentum

Hi I made custom sliders and wanted to run some scripts when I stop sliding a knob.

I tried to use CHOP Execute - def onValueChange() but I want onValueStop something like that.
I thought it’s good to use any chop which tells it’s momentum.
If it’s 0, which means knob stopped.
Any good idea?
Thanks all.

There are a few ways ways to approach this.
The first technique that comes to mind to measure and detect momentum is to use a delay CHOP with few frames of delay, then subtract the actual value and the delayed one.
If the difference is zero it means that the fader is not moving.

See very raw example attached
Momentum.toe (4.1 KB)
I have used a chop Exec DAT in my example but also a logic CHOP could be set to do the same.
Change the delay amount to fine tune the responsiveness.
In that math1 you can also see some sort of acceleration.

I hope that helps!

1 Like

It’s impressive! Thanks. That’s exact what I want.
Appreciate it.

1 Like

Also check out the SlopeCHOP. :slight_smile:

1 Like

It’s good to know. Thanks!

This uses Slope, Math (positive),Trail, Analyze, Logic CHOPs to make sure it’s the same value for every frame over a certain time. i.e. not jittery. An interesting use of Trail with Analyze.

motionless.tox (1014 Bytes)

1 Like

Hey Greg. It’s Atsushi. I miss a day I visited you guys’ office in Toronto 2 years ago.
Anyway, I’m so impressed to hear from you.
Thanks for an example tox. It worked nicely.
If other people need this kinda tox, “momentum chop” would be in TouchDesigner in the future? haha