Forums > MaxMSP

using a number box to set a slider value AND display it?

June 13, 2008 | 4:10 am

I haven’t been able to figure out how to do this. I want to use a range slider and have 2 number boxes that display the high and low range of the slider, but can also set the values. When I tried it the way I thought it would work, Max crashed on me. =[

I am using Max 4.6. Someone please let me know how to do this, or paste the patch text so I can open it and figure it out.

Thank you!
Mike


June 13, 2008 | 4:17 am

do you mean rslider?

#P window setfont "Sans Serif" 9.;
#P number 282 84 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 130 83 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user rslider 130 66 162 10 1001 1 0 13 0;
#P window linecount 1;
#P newex 130 114 162 196617 bondo 2;
#P newex 130 208 62 196617 prepend set;
#P newex 130 180 162 196617 pak 0 0;
#P newex 130 145 40 196617 change;
#P newex 282 146 40 196617 change;
#P fasten 3 0 5 0 135 239 106 239 106 55 135 55;
#P connect 2 0 3 0;
#P connect 7 0 4 1;
#P connect 6 0 4 0;
#P connect 4 1 0 0;
#P connect 4 0 1 0;
#P connect 5 1 7 0;
#P connect 5 0 6 0;
#P connect 1 0 2 0;
#P connect 0 0 2 1;
#P window clipboard copycount 8;


June 13, 2008 | 4:31 am

On Jun 12, 2008, at 9:10 PM, mike wrote:

> I haven’t been able to figure out how to do this.

Here’s one way:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 161 268 62 196617 prepend set;
#P hidden newex 161 115 62 196617 prepend set;
#P number 123 116 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 123 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user rslider 123 134 18 130 128 1 0 0 0;
#P window linecount 2;
#P comment 154 221 100 196617 Grab the values from the rslider outputs.;
#P hidden connect 3 0 1 1;
#P hidden connect 2 0 1 0;
#P hidden connect 1 0 5 0;
#P hidden connect 1 1 4 0;
#P hidden connect 5 0 2 0;
#P hidden connect 4 0 3 0;
#P window clipboard copycount 6;

Chris Muir
cbm@well.com

http://www.xfade.com


June 13, 2008 | 5:09 am

always other ways to do it.

– Pasted Max Patch, click to expand. –

June 13, 2008 | 5:40 am

Wow! Thank all of you for your help!

I think your method is probably the simplest and quickest to implement into my patch, Chris. It’s pure and simple – just using prepends as the middle man. Nice!

Thanks again, guys. I’d be pulling out even more of my hair if it weren’t for all of the helpful users on this site.

Mike


June 13, 2008 | 1:05 pm

Once again, Chris and I think alike; our
solutions are *almost* exactly alike.

The "teaching moment" here is twofold: first,
the use of the "set" message to set the
number box values without outputting
a value, and – secondly – the notion that
you need to grab any outputs you actually
use somewhere else from something *other*
than the number box connected to the set
message [connect your imaginary destination
number boxes to the two number boxes in
the patch instead of tapping off the
rslider object and honk around with
the rslider and the number box to see why
this is what you need to do. Should become
obvious].

Generally speaking, the "set" message is used
all over the place in Max to change the
value sent to a "hot" inlet of a Max object
WITHOUT triggering any output or calculation.
Along with trigger, it’s one of your friends
as a beginning user.


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