counting from value to value, slider value goes fluently to new slider value
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.).
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.
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.
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. :)
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…
scale: I though so.
geniuses: I’m sure about that. ;)
I usually title such requests with the words ‘simple math problem’, and the responses are many, fast, and always right..good luck
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. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1055.3oc0Y11aaBCDG+0IeJrPSZuoKxFyiSS6iwdyzTkC3zvJXGAN8gMsu6y 9LzQSCARJgjIUERLF3te24i+m6umOyYo7IdkC5ynuilM62ymMCFxLvr5eOyo f8TRNqBllShrnfKTN2XOmh+jBFOOSvQr7RNK8YTpjWgdbMSgdVtEI37TTlBo jMW0FlJYcl3taK4IJ6SOlfWfuA455CGn1CjEXzOpuHw1hLQNWA1AodvURgRv J3fM7MdYJSvZdJYovnxk+7SwdN+6tH2pZtM3V2lpreA2Fh6BrYz+Let4iaFH XVkK026W7vRdkFSLUlTzxKIj.B3X9TyAb8Gu3i6ALDbMRvvr8wiKXb2OXbqG 0Nj54Mbq0XbSlN5ibVxD247hMLB.TveTaQuIwRkUvKc5mOjP3fm6g4i6QxGx oxmQkMK2pTRwPnPSxRymGNKosmh2umR5xSqS.d+KU5rX.Ix+LjxGEdsmxC0R wKzA0E8TOIl.kSHddCsbRCZovgPuCiV5QhV+iDsi9BkBdUE6N9aPJQ6xX8eX beDMDpLSHgCu.ssxbfknv0QhGo5OQdG4pxoil6fyNS0rbIxab4B8RxktDAYT 5TgXnkZ0NxUnrhMkxG3sm5dvjqG.HZT8qwBG2pcjytxmtnwWPqYOv0x9PrzT jon1GqPlWmipRX4bzCr7svo0hDKQo7prRsPwRVwF6rzDDpDVIQJiVR0Zt8r5 mrpBsRVBCkHKMvDwztm.3t4parFycHwbh1IY6IJ34YewoObfFCQAZvHEEBiu XQg50vFbUngXV0mQx7zaA3eiVa9i2VGGLH+qGThAjeZeaLEGMpoo9AWL.Uoj kbHmBUkmkxKqSLyDnkaStmq5gJPBSbc+JdiKUl71VdqCRiauvXj0h4e8z9Qu RrqAQvoJv1e5DXehsR0DpsZCG4No7B++nSJZXcn8TiyznIKNaqW0ihVpafUX wPEzRIsbce2X3GgGCABNLAdIDZUN2shsQL0GsBsxoWe1t3l5tveDKxQO4hb1 uLAcbtgkb+vHDwlVDDNpEGbuJay4C59b9faes4z.F+yQeNjfKIX5HawJKpej XechOYbkLbIAxfJ35Z63006Xq3RwmbIWuqtJt6aSr5dwSz4X6nnmqciBlC3g 67+NA7Py3ulWU5FbSZdJMaqL5eNot2WUl.xiZOI2WMo0YoobQa4+EYoajYBU sQzQzan1jYy6Pj9rIxqlz41lLaJc+bhLsbxaH1DdZsI5UnM4O.axrY7Wawtc L7qhX2DaStCgSFsISnMMjzocr6ysIYT12aISvlNhRlTJr0ZQfH.ZHzKRDnm7 8aq8wuoMKaHI9Sa.cmT58aRzIGR8khY1xgIzj7BGRpzzpdYGDzQxT3jpdwGO TaZB4zPxv8wWe1D88jOo+wel+WHTgORK -----------end_max5_patcher-----------
Thanks a lot Tim!
Saved my project.
Forums > MaxMSP