Forums > MaxMSP

how to detect clockwise counterclockwise

Feb 12 2012 | 3:18 pm


i would like to be able to detect direction of spinning on a touch controller.

the problem happen when i cross the 0, even i turn clockwise its interpreted as counterclockwise.

please take a look at this very small patch

-- Pasted Max Patch, click to expand. --

Feb 12 2012 | 4:04 pm

you could build in a check in the range around 0, pseudocode:

IF previous_value equal (or close) to 127 AND new_value equal (or close) to 0 THEN clockwise

and vice versa

or for example catch a value jump < = -120 and interpret it as clockwise turn

Feb 12 2012 | 6:02 pm

thanks a lot for your time.
i try both ways that you show me.
heres s the smallest one. for sure it could be smaller and cleaner but it already do the job very well.

-- Pasted Max Patch, click to expand. --

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

Forums > MaxMSP