hello max patchers! question for you.
i'm trying to tame a joystick and can't come up with an elegant solution for this problem. the joystick produces an integer from 0-255 (left to right). when not in use the joystick should rest in the center of that range. upon releasing the joystick, it doesn't fall back to the center of the integer range, and for further complexity, it's very sensitive and constantly shifting around 10 integers even when not in use. i've come up with a rough solution as for how to handle this but eliminates several integer values from use, so i'm wondering if there's a more strategic way to handle this. a [line] or slew function won't work as that will again produce constant wiggling integers (even if that joystick is not in use). i suppose i could look for a certain amount of change before outputting the data to other max objects, or something along those lines. the goal is to reset the joystick to the center of the range while preventing the constant integer wiggling.
here's the patch with detailed notes: