Forums > MaxMSP

How to: make a number box only display multiples of two

April 30, 2012 | 8:46 pm

I have a number box with a range of 32. In presentation mode, I would like a user to be able to alter this number box by dragging the mouse, however, I only ever want the user to be able to select multiples of 2. i.e dragging the box down from 32 will display 30, 28 then 26 etc. Is there anything I can do to get around this?

April 30, 2012 | 9:09 pm

Perhaps this is the most elegant way to achieve this.

— Pasted Max Patch, click to expand. —
April 30, 2012 | 9:11 pm

I hope this will help you :

— Pasted Max Patch, click to expand. —
April 30, 2012 | 9:14 pm

I meant "isn’t the most elegant way…"

Also, you’ll need the .txt file for coll.

  1. blergh.txt
April 30, 2012 | 9:17 pm

put lcd in background or ubutton in foreground, and use those to get mousevalues.

scale mouse data to int, then *2

April 30, 2012 | 9:22 pm

That is exactly what I am looking for Pierre G.

April 30, 2012 | 11:20 pm
— Pasted Max Patch, click to expand. —
May 1, 2012 | 9:01 am
— Pasted Max Patch, click to expand. —
May 1, 2012 | 9:42 am

Broc I think you got the ‘most elegant way’…

May 1, 2012 | 5:50 pm

Awesome! I really need to explore more of the live objects. I use live.gain almost exclusively now, but I haven’t really explored the others. Thanks for posting that!

May 1, 2012 | 6:23 pm

Very cool that you can set the steps in live.numbox!

But…can Pierre or anyone else explain why his patch works the way it does? It’s confounding my brain…if the result of the "if" statement comes out, shouldn’t there be a stack overflow created?

May 1, 2012 | 9:18 pm

Take a closer look at his patch, there is a hidden element that helps achieve this result :)


May 5, 2012 | 9:19 pm

wow, I am an idiot :D

no wonder I couldn’t figure out how the number box was responding to clicks when "ignore click"… sheesh, it was the other one. DOH!

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

Forums > MaxMSP