Forums > MaxMSP

switch flickering

Mar 22 2011 | 2:11 pm

I have an if statement in max that says if the x+y co-ordinates reach between 200-300 then bang-i tried connecting this to a switch and every time the number value changes the switch will flick on and off- how do i prevent this so that it turns it off once?

Mar 22 2011 | 6:14 pm

Can you post a simple patch?


Mar 22 2011 | 6:39 pm

Do you really need the if statement to produce a bang? Here it is producing a 1 when in bounds – [if ($i1>200 && $i1<300) && ($i2>200 && $i2<300) then 1 else 0]

Mar 24 2011 | 3:26 pm

Yes, the switch will toggle because the expression will continue to be true while within those bounds, and a bang connected to a switch will make it swap states; you need to look at the helpfiles for [togedge], [onebang] and [select] or [==] or [split] if you require an action from when the expression is true only the first time. Otherwise, as Chris says, don’t use [button].

Mar 28 2011 | 4:28 pm

thanks everyone. chris your right-simple solution im still new to max-my bad

thanks again

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

Forums > MaxMSP