hi guys,
so i have been trying to get this last problem sorted out the last few days with no luck.
i am trying to get this else command to just send the midi message one time regardless of the changes in "touchX".
it reads the values of a resistive touch screen, that is where the value of the "touchX" comes from.
basically i need the above highlighted part to just send the midi message one time but it is being resent every time there is a change in "touchX".
i have tried everything i can think of.
Is touchX stable? How much does it move around? Under what circumstances?
If you keep touching the screen, but not moving, does touchX remain constant, or does it vary slightly?
What is to happen when touchX is equal to 127? You have an if test that might be true when touchX is greater than 127, and one that might be true when it is less than 127, but nothing for when it is equal to 127.
What does the rest of the code look like? With just this code, you'd need to introduce another variable to keep track of whether it is necessary to send the midi message with the 127 in it.
Finally, it would seem like you'd want to send the stop message (once) whenever motion stopped (touchX == touchXOld), not just when it stopped AND the value of touchX is small.
hey Paul,
the screen is mapped to give out readings from 0 up to 126 and will send out a stable reading of such if the finger is held still.
when you release the screen the value goes up to 127 (or more) and sends the midi command with the 0 velocity to turn the command off. that part works good enough since the value doesn't change while the screen isn't being touched.
it is just that every +1 or -1 of the screen value re-triggers the midi cc command of 127 resulting in a choppy sweep between the range.