1 bang once two input criteria have been met?

Tobias Welby's icon

Hi,

I feel like there is probably a very simple solution to this, but at the moment i am stumped.

I need a bang to turn of a toggle once two separate variables have been met.

The input for both of these variable is different, so I have had difficulty using the Sel object, or the if statement.

Does anybody know if there is a way to do this?

Any help would be greatly appreciated.

Thanks!

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

[if ... ] sounds ok for this task.
See the attached patch.

brendan mccloskey's icon

Hi
[expr $i1==$i2] if both variables must match; [expr $i1==30 && $i2==80] if they differ. Then do [sel 1] for a bang

Brendan

Roman Thilenius's icon

version 3:

[== 30] [== 80]
[+ ]
[== 2]

Christopher Dobrian's icon

All of the above solutions make an assumption about which looked-for number will arrive first. Here's a more order-neutral method.

Max Patch
Copy patch and select New From Clipboard in Max.

Peter Ostry's icon

All of the above solutions make an assumption about which looked-for number will arrive first.

Nope. The first example is a [bondo] in front of an [if]
;-)

brendan mccloskey's icon

message ordering is NOT explicit to the novice; let them work it out for themselves? But Chris highlights this.

favourite object is still [trigger]

I refer the honourable gentleman to the comments I gave some months/years before