Numerical Stack Overflow

May 4, 2011 at 3:03pm

Numerical Stack Overflow

Hi, I’m more used to PureData however, trying to create a patch within Max for a project.
I am basically trying to move a fader and then 5 seconds after the slider has stopped being used i want it to slowly revert back to its original setting of 0, by -10 every second. So that when you move it, then leave it, it will change back. However, no matter how i do it i always get a stack overflow.
Can anyone please help! It’s very important.
I have tried to use a pipe object but it always repeats the movement of the slider over and over.
Any help would be much appreciated,
many thanks,
Chris.

#56860
May 4, 2011 at 5:08pm

Trying thinking about it like a math equation. Lets say that on the mouse up the slider’s value is 78. If you divide by 10 then multiply by 10 you will go from 7 to then 70 (using ONLY integers and not floating point numbers). Then you can just subtract by 10.

All of those intervals can be control by a metro object which can be shut off by using “== 0″, checking for the sliders value to equal 0.

Let me know if you still need help.
GW

#203817
May 4, 2011 at 5:41pm

In these situations it is best to separate your UI from your actual data. Something like this might work for you:

– Pasted Max Patch, click to expand. –
#203818
May 5, 2011 at 9:39am

Works perfectly, thanks very much to both of you.
Chris.

#203819

You must be logged in to reply to this topic.