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

DJF's icon

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?

AaronMButler's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Perhaps this is the most elegant way to achieve this.

Pierre Guillot's icon
Max Patch
Copy patch and select New From Clipboard in Max.

hi,
I hope this will help you :

AaronMButler's icon

I meant "isn't the most elegant way..."

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

3800.blergh.txt
txt
Roman Thilenius's icon

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

scale mouse data to int, then *2

DJF's icon

That is exactly what I am looking for Pierre G.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.
broc's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Stephane Morisse's icon

Broc I think you got the 'most elegant way'...

AaronMButler's icon

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!

seejayjames's icon

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?

Ben Bracken's icon

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

-Be

seejayjames's icon

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!