Forums > MaxMSP

Making Max aware whether Integer is counting up or down

March 6, 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


March 6, 2013 | 10:53 pm

Something like this?

– Pasted Max Patch, click to expand. –

Best, Jeremy


March 6, 2013 | 11:05 pm

This is even nicer:

– Pasted Max Patch, click to expand. –

March 6, 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


March 7, 2013 | 8:40 pm

https://vimeo.com/61288523


March 7, 2013 | 10:02 pm

That keyboard is having the time of its life! Thanks for sharing the intermediate results! :-)

Best, Jeremy



mcQ
March 7, 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.


March 10, 2013 | 2:22 am

forgive the messy patch but I think what I’ve done solves the problem you’ve brought up mcQ

Basically the int box at the bottom says how many steps to go and the toggle indicates in which direction

– Pasted Max Patch, click to expand. –

March 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 | 10:49 am

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.


Viewing 10 posts - 1 through 10 (of 10 total)