How do you integrate acceleration into a patch?


    Mar 04 2022 | 8:42 pm
    Hi folks! Any suggestions on how to integrate acceleration into a patch? The whole idea is simple. I have a gamepad and there is a joystick that goes from -1. to 1 on the y axis. And the resting place is at 0. And I want to move a motor into one direction (if pressing towards 1.) or the other direction if pressing towards -1. But if I press towards 1. but not all the way through, let's say, I press all the way to 0.5, I would like the motor to go with half the maximum speed into that direction. And if I take my hand and the joystick comes back to 0., I would like to motor to stop. And the other way if I press the joystick towards -1. I kinda feel that it is easy, but I am stuck none-the-less. Thank you so much for your help

    • Mar 06 2022 | 12:33 pm
      if you lay down messages you use to drive motor direction and speed, you will simply see relation between joystick 0 .. -1 and move backward, or 0 .. 1 and move forward... to make sure, I would reserve a little range arround 0 for stop. split -1. -0.01 > scale -0.01 -1. 1 255 combine with backward direction value split 0.01 1. > scale 0.01 1. 1 255 combine with forward direction value