simple logic pt. 2

brendan mccloskey's icon

Hi
forgive me for thinking aloud, how do I say (in Max):
"if any pair of numbers contains an integer > 0 then bang when that pair is received" e.g. 0-1, 2-0, 6-0, 1-2 BANG".

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

This small simple patch is the context

Thanks all
Brendan

brendan mccloskey's icon

Sorry for the noise:

[zl stream 2] ===> [unpack i i] ===> [*] ===> [> 0]

Tutors Feedback Report:
Must try harder!!

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

related noise: how to test for true in two conditions, preferably using bangs, all objects I try appear to remember the right input argument/value

Brendan

(top bang trigger is just for testing)

3404.logik.jpg
jpg
brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Solved, but in a cumbersome inelegant way; tried [timer], [counter], every [zl] object under the Sun. This uses [if], plus a [delay 5] to reset it:

Haven't had a Max challenge like this in a while...(thinks)....must be losin' my edge....

Brendan

LiamCormacGould's icon

don't [zl] objects clear their stored stuff with a (zlclear) message or wotnot?

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

Also this isn't what you're looking for I don't think but hey.....

brendan mccloskey's icon

Hey thanks for this, it introduces some ideas I didn't think of, especially where the list exceeds 2 ints.

Brendan

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

The problem is essentially that you're trying to milk state out of a message that only has time (bang.)

brendan mccloskey's icon

Cheers Chris

I guess I was looking for an object with two cold inlets, which could assess the three possible permutations: 1-0; 0-1; 1-1. Your (stop) message to [onebang] is the closest I'll get. Thanks

Brendan

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

Maybe buddy would give you the behavior you seek?

brendan mccloskey's icon

Hi Christopher, and thanks for updating my own Max lexicon!

most times Max brings me joy; occasionally though, it causes major headaches - because I'm staring at a broken algorithm, fully aware that there's a simple solution - an object, a combination of objects - that will fix it.

In the case of my toggles' states, I solved it with [*] ==> [togedge]; which does exactly what [&&]andChris' version of [onebang] do too in this context.

Happy Hertz Day (according to Google)

Brendan

ps I forgot to leave a space between andand and and and Chris...........:)