Forums > MaxMSP

Comparsion of two toggles

October 14, 2009 | 11:43 am

Hi,
I have one maybe primitive still newbie question:
I have two toggles and I want to use the first one but only when the second is ON. BUT the first one toggle state ON lasts longer, and I need to save the whole ON signal. So the second toggle might act only as a initiator (like open the gate only when they are same), but the gate remains open untill the first one is still ON.

I use MAX 4.5 so I cant read 5 patches…

Thanks a lot for any advice.


October 14, 2009 | 1:07 pm

You might want to have a look to logical AND (the && object)).


October 14, 2009 | 2:10 pm

Hi,

yes i know this (and use it…) but this case is more complicated.
I cannot use &&, because it will be ON just short while (when both toggles are ON].
What I need is to use second toggle as a switch and than stay ON untill the first toggle is ON. (but when the fisrt is still on, the second is already OFF)
If I will use and than it will play too often (because first toggle is ON quite often)…

thanks for any idea


October 14, 2009 | 2:30 pm

I ve found one unlogical thing for me.
I use this condition (that makes the second toggle signal)

if $i1==1 && $i2==1 then set 1 else 0

this works for the firts look well – when I connect the toggle to the output it works at the right moments (swithing ON and OFF).
BUT on the output of this toggle there is NOTHING.

have you idea what is wrong?

thanks a lot!!!!


October 15, 2009 | 8:01 am

if $i1==1 && $i2==1 then 1 else 0

this works.
Finally I´ve totaly change the patch and now I dont need that thing.
But anyway it interests me – does anyone know how to solve it?

In simple words: TWO TOGGLES,
first one has longer signals and this signals are quite often,
second one has very short signals and they are not so often.
If the second toggle is on, the first is on also (and stays on longer time).
WHAT I WANT is to use the second toggle for opening the gate for the signal from the first togle, but this gate must stay opened until the second toggle is still on.

It must be very simple!!!

Thnank you.


October 15, 2009 | 12:20 pm

maybe post a patch to make things a bit clearer ?


October 15, 2009 | 1:22 pm

[if $i1==1 && $i2==1 then 1 else 0] is functionally exactly the same as a [&&] object.

From your description, it seems as if you may be confusing the behavior of [&&] and [||]. But without a patch it’s hard to tell.

– Pasted Max Patch, click to expand. –

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