Forums > MaxMSP

How to check for two conditions and output according to state of either?

January 13, 2013 | 10:52 pm

I need something like this:
a + a = a
b + b = b
a + b = c
b + a = c

So the position doesn’t matter. I’m kinda lost

edit: I am aware of [if] and multiple conditions, but you need to specify for each input, i want it input-independent. just checks both and outputs if the combination is right.

I’d use "+" but I’m using Symbols. The stupidest way would be a dictionary in coll and an object that converts symbols to numbers.


January 13, 2013 | 11:07 pm

for symbols both, the comparison operators and [if], are out of question.
you can compare (here: check for equality) symbols using [zl union] and [zl sect] relatively easy.

to "add" 2 conditions you would just add the 2 results (0 or 1 for each comparison) and
check for 0 or non 0.

example:

[> ] [> ]
|      |
[if ($i1+$i2) then 1 else 0]


January 13, 2013 | 11:43 pm

how bout this?

– Pasted Max Patch, click to expand. –

January 14, 2013 | 12:16 am

unfortunately this isn’t any more simple than my solution.
I might as well be specific and post a patcher, I’ll open a new topic because the patcher has other problems as well


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