simple logic pt. 2

Feb 21, 2012 at 4:52pm

simple logic pt. 2

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”.

This small simple patch is the context

– Pasted Max Patch, click to expand. –

Thanks all

Feb 21, 2012 at 5:08pm

Sorry for the noise:

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

Tutors Feedback Report:
Must try harder!!

Feb 21, 2012 at 5:49pm

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

– Pasted Max Patch, click to expand. –


(top bang trigger is just for testing)

  1. logik.jpg
Feb 21, 2012 at 8:26pm

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:

– Pasted Max Patch, click to expand. –

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


Feb 21, 2012 at 10:32pm

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

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

– Pasted Max Patch, click to expand. –
Feb 21, 2012 at 10:56pm

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


Feb 21, 2012 at 11:31pm

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

– Pasted Max Patch, click to expand. –
Feb 22, 2012 at 11:11am

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


Feb 22, 2012 at 4:11pm

Maybe buddy would give you the behavior you seek?

– Pasted Max Patch, click to expand. –
Feb 22, 2012 at 4:26pm

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)


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

Feb 23, 2012 at 6:17am


i’m not sure to understand the question ;-)

– Pasted Max Patch, click to expand. –


Post scriptum : i edited the patch to add [next] way …


You must be logged in to reply to this topic.