Relative Controller position instead of absolute

edsonedge's icon

Im trying to figure out what is the best way to get a relative position into a float - from a joystick

that is: I want for example to add to the number of a float box when joystick is pressed forwards and subtract when pressed backwards - and then only do this if the trigger button on the joystick is pressed (othervise the movement of the joystick should have no effect on the floatbox)

Best regards

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

A suggestion:

Christopher Dobrian's icon

Here's an example patch for a related question, which might be of some help to you.

Max Patch
Copy patch and select New From Clipboard in Max.

edsonedge's icon

Thanks guys

But neither pathces do what I am looking for

The below patch does sort of what I want, but it only increses the value of the lower float box

I want to be able to trigger the higher float box off/on, which is connected to the absolute position of a mouse or a joystick
- and then I want the counter objject to (somehow) know if the float in the above number box is increasing or decreasing

I know I can flip if the counter object counts upwards or downwards with a 0 or 1 message - but I am wandering if there is some way of detecting if the upper float box is increasing or deacreasing; automatically

Max Patch
Copy patch and select New From Clipboard in Max.