Need Help - Selecting a range between 2 number outputs
I am working on a tangible interface where I can track the X & Y values of a symbol but I don't know how to set a range so that when the symbol goes within that range it triggers a bang.
e.g. trigger a bang if the symbol goes lower than a value of 60 for the X axis and higher than 440 on the Y axis.
Help would really be appreciated. Thanks.
If I understand you correctly something like this should do it:
Thats great thanks. How would I do it so that it will only output a bang if they are both in the correct area instead of a bang for each?
Is this what you mean?
That is exactly what I was looking for, thanks mate!
i cant look at max5 code and i dont understand the given case, but something like
[code]
[strong]
[if ($f1>200)&&($f1300)&&($f2
[/strong]
[/code]
should do the job.
under circumstances you will prefer to do the opposite, and bang only when
the mouse leaves the wanted area.
good use of the [change] object should also be on your to do list for such
interface things.
-110
[if ($f1>200)&&($f1300)&&($f2
ahhhhh!
btw, (now that i found out about the markup code) you can also
combine the if_then logic with [clip]ing your X and Y values.
let me try this without looking at max - i am hopefully getting it
right offhand:
for X:
expr ( ($i1>$i3) && ($i1$i5) && ($i2
for Y:
expr ( ($i1>$i3) && ($i1$i5) && ($i2
inputs:
X mouse = $i1
X low limit = $i3
X high limit = $i4
X mouse = $i2
X low limit = $i5
X high limit = $i6
the two expression will output 0 when the condition is not met.
this means that you will have to add a [route 0] behind, and it also means
you cant use negative values (and also not 0 !)
-110