How do I limit a counter between two numbers (in this case 0 and 127) so that it does not start over again?
Im trying to convert a rotary encoders inc/dec mesaage (0 and 127) into an absolute value (between 0 and 127 depending upon the encoders position).
Using counter I can set min and max values of 0 and 127, but I need the counter to stop when it reaches these. For example when I turn the encoder from 0 around to 127 and further, I need the counter to stop counting at 127 and stay at that value untill I turn the encoder down, when the counter will need to start counting down too. At the moment when the counter reaches 127 it will start counting again from 0.
My reason for doing this is because of a quirk of Ableton live 6's midi output. I am trying to light LEDs with the output from Live, but for some reason when an encoder is mapped to a control it will only output a midi message on the increment and not the decrement. This function works fine for absolute values that potentionmeters and buttons use. So if I can make an encoder apear as a potentiometer within live it will hopefully work.