Making Max aware whether Integer is counting up or down

    Mar 06 2013 | 10:44 pm
    I want to set up a MIDI knob to a toggle so that when I turn the knob clockwise - counting up to 127- it turns a toggle on. And when I turn the knob counter clockwise the toggle gets turned off. How would I do this? I have been thinking for a while and I have no good ideas!
    Thanks for your help

    • Mar 06 2013 | 10:53 pm
      Max Patcher
      In Max, select New From Clipboard.
      Something like this?
      Best, Jeremy
    • Mar 06 2013 | 11:05 pm
      Max Patcher
      In Max, select New From Clipboard.
      This is even nicer:
    • Mar 06 2013 | 11:17 pm
      Wow this is exactly what I needed thanks! Such a quick response too !
      In case you were wondering, I am using this so I can control a stepper motor with a knob, now when I turn clockwise the motor steps one step for each number clockwise sent and one step counter clockwise when I turn the other way
    • Mar 07 2013 | 8:40 pm
    • Mar 07 2013 | 10:02 pm
      That keyboard is having the time of its life! Thanks for sharing the intermediate results! :-)
      Best, Jeremy
    • Mar 07 2013 | 11:22 pm
      one possible issue i see with that is that if you change that data too quickly, max will skip numbers, like if you [dial] -> [print] and move it very quickly you will notice it skips numbers, seeing as i assume it scans for the numbers being output at a certain rate. so if you have it moving 1 up for every 1 value output, and 1 down for every 0 value output from the toggle, then if you have the dial set to 100, then move it down to 99, 98, 97, 96, then move it fast enough, it will output say a 50. which might only move your motor 5 steps back, instead of 50 steps back.
      you could maybe find the difference between the current number and the last number and have the motor move that many steps.
    • Mar 10 2013 | 2:22 am
      forgive the messy patch but I think what I've done solves the problem you've brought up mcQ
      Max Patcher
      In Max, select New From Clipboard.
      Basically the int box at the bottom says how many steps to go and the toggle indicates in which direction
    • Mar 10 2013 | 9:34 am
      Was this a uni assignment? It seems like we had a few questions about the same thing in like a weeks time?
    • May 14 2013 | 5:49 pm
      Hello, this is great !!
      May be not so far away from your project, do you know how I can get a knob and a toggle so that when I'm turning the knob I have the toggle on and when I stop turning it I have the toggle off ? I just dont manage to compute it...
      Thanks for your help.