Forums > MaxMSP

simple logic pt. 2

Feb 21 2012 | 4:52 pm

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 | 5:08 pm

Sorry for the noise:

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

Tutors Feedback Report:
Must try harder!!

Feb 21 2012 | 5:49 pm

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 | 8:26 pm

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 | 10:32 pm

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 | 10:56 pm

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


Feb 21 2012 | 11:31 pm

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 | 11:11 am

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 | 4:11 pm

Maybe buddy would give you the behavior you seek?

-- Pasted Max Patch, click to expand. --

Feb 22 2012 | 4:26 pm

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………..:)

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

Forums > MaxMSP