Dynamically change size of rslider?

Jan 2, 2012 at 9:51am

Dynamically change size of rslider?

Pretty new to Max and am looking for a little help with the following…

I’m using rslider to set loop start and end points in a groove object. I know how to change the maximum size to match the length of the sample using the Inspector. What I am wondering though is if there is a way to automate this so that when loading a new file into a buffer the max value of the rslider is changed to match this?

Paul

#60962
Jan 2, 2012 at 10:27am

Hi Paul.

To get the length of the buffer, you can use [info~].
to dynamically change the size of [rslider], you can send it the messages
“min $1″ to set the minimum value, and “size $1″ to set its range.

#219568
Jan 2, 2012 at 10:31am

by the way, to know which message you have to send to set an attribute that you see in the inspector, you can simply drag and drop the attribute from the inspector to the patcher.

#219569
Jan 2, 2012 at 11:22am

What you could do, that might be a whole lot easier, is use a scale object. Then all you need to do is feed it the length of the buffer as the “output max” value when the buffer changes. Might be much easier than modifying the rslider directly.

#219570
Jan 2, 2012 at 11:58am

Many thanks to you both for the info. Hadn’t realised messeges could be sent directly to an Inspector, very useful to know!

I will also give the scale method a go.

Paul

#219571

You must be logged in to reply to this topic.