So I'm banging my head against the wall. I'm a little bit of a noob in MaxMSP and I'm trying to make a patch that can translate the information received from a sensor (between -1. and 1.).
The variation speed should be proportional to the amount of "force" received in the sensor... That is to say, the closer the sensor value to "1.", the faster should the number increase, and viceversa for "-1." (it should decrease faster).
Another restriction is that the number that increases needs to stay between 4. and -4. and when those values are reached, even though the sensor keeps telling it to increase, it should stay in that value. This relates to another problem, the number should be responsive to an immediate change of sign in the sensor input. I have tried using a [scale] [metro] [f] [accum] [line] and [zmap] combination and it works more or less ok, the only problem is that in the [accum] object, the values keep increasing if the sensor keeps sending a positive or negative value... therefore to start decreasing from 4 down to -4 again when the sensor starts sending negative values again it takes a long time, since [accum] can be sending out values by 8. or 9.
I tried clipping the value output of [accum] and sending it back to itself, but I overflown the program... Tried delaying the clipped value with [delay] and [f] but I also crashed the program :(...
Any ideas would be very much appreciated! :)