Forums > MaxMSP

counting from value to value, slider value goes fluently to new slider value

April 1, 2010 | 6:06 pm

Hi, Im trying hard to fade fluently from one value to another. trying to control servos slowly from old value to new. Basically try to imagine slider on one left and slider on right. If I click on left one, the right one slides to the new value fluently, in speed x (metro for ex.).

patch: http://cycling74.com/forums/topic.php?id=25637
I tried to solve that using [counter], but its hard to set up correctly when it should count up and down. It not always works, for ex. if the new number is not bigger than the number before the previous.

Perhaps there is some object making this really easy.


April 1, 2010 | 7:37 pm

If I understand your request, I think [line] might help here: [slider]->[$1 100] message -> [line] -> [slider]. That’s the simplest way to do it in Max; but i’ve never used serial-output to control servos.


April 1, 2010 | 8:33 pm

great! now I will just relativize speed for different values to fade (now same time to fade from 1-100 as 1-10) and its done. :)
thanks


April 1, 2010 | 8:54 pm

not sure about the last bit, but maybe look at: [maximum], [peak], [scale] and related objects; you might be able to cobble something together – there are some geniuses on this forum who could do this in their sleep…


April 1, 2010 | 9:11 pm

scale: I though so.
geniuses: I’m sure about that. ;)


April 1, 2010 | 9:14 pm

I usually title such requests with the words ‘simple math problem’, and the responses are many, fast, and always right..good luck


April 1, 2010 | 9:45 pm

This should get you started (It does what you need if I’m understanding correctly).

Although there is a problem with the method, in that if you set a new destination value before line has finished ramping, line might have to "jump" to the old destination value (now the starting value). It may not be an issue unless your ramp time is long though.

– Pasted Max Patch, click to expand. –

September 9, 2010 | 12:22 am

Thanks a lot Tim!

Saved my project.


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