Forums > MaxMSP

Message Boxes acting crazy

Dec 17 2008 | 4:45 am

Essentially, I’m randomizing a metro that fires out a value which runs through an if then state then bangs a message box accordingly. My issue is that the left most message box is constantly being banged (my guess is from the metro)

I’ve tried both [set x] in the left and [x] in the right, I’ve tried bangs instead of toggles, I’ve amended my if/then in every which way…

can someone offer advice or a suggestion why I’m continuing to work on this?


— Pasted Max Patch, click to expand. —
Dec 17 2008 | 5:33 am

Try using route 1 below each toggle. This will convert only the "1"s
coming out of toggle into bangs for the messages.

The problem is in hooking up the toggles to the message boxes. Right
now the toggle boxes are sending 1s and 0s to the message boxes. The
problem is that it’s not just "1"s that trigger the message boxes:
"0"s also trigger them. (Shut off the metro, and click the toggle
above 3. It sets the lower message box to 3. Now click the toggle
above 4. A message of 4 gets sent. Then, deselect the toggle above
three, and watch as this 0 from toggle ALSO sets the lower message box
to 3.)

here’s a quick fix–your patch + lots of routes


— Pasted Max Patch, click to expand. —

Dec 17 2008 | 7:15 am

route definitely works but why not send a bang from your if expression when the number matches, or even send the number directly…

here is a quick solution that might simplify your life a bit… I hope.

— Pasted Max Patch, click to expand. —
Dec 17 2008 | 11:09 am

If those are the actual ranges you’re going to use then there is a much simpler way to go about getting the numbers you want. Here’s an example. Obviously if those numbers were there just to demonstrate and you’re going to use different size ranges this won’t work so well.


— Pasted Max Patch, click to expand. —
Dec 17 2008 | 11:21 am

— Pasted Max Patch, click to expand. —
Dec 17 2008 | 6:26 pm

Don’s patch is a great improvement over the original, but the second random should be a [random 10].

Also the original post is apparently confused about how random works. A [random 100] objects produces values from 0 to 99 inclusive. The original patch never tests for zero (a possible output value) and tests for 100 (an impossible output value from a [random 100] object).

If you want values from 1 to 100 inclusive, then use a RNG object with sensible syntax, like [lp.tata 1 100].

You probably also want to prevent the [random 3000] object from sending zeros to your metro.

— Pasted Max Patch, click to expand. —

BTW, using regexp is cute, but it would be much easier and more efficient to use some simple arithmetic, say [/ 10]. But unless you need the larger pseudo-random values, Don’s approach is most straight forward.

Oh, right, [lp.tata] is from the Litter Starter Pack, see the link below. However, you currently need Litter Pro for Max 5.

Hope this helps,

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

Forums > MaxMSP