Change between match and don't match

May 14, 2006 at 3:34am

Change between match and don't match

Hi! I’m trying to activate sounds in different zones on a drawing, on the screen. I already use Mousestate to recognize the move and choices of the mouse.

Actually, I need to turn on the toggle when I clic on at a precise location but I’d like the toggle to turn off if I’m not on this precise zone, even after I’ve already clic on the mouse.

If the mouse is at the right place, then 1; if not, then 0.
If I clic on the the mouse, then 1; if not, then 0.
If clic on the mouse at a wrong place, it should give 0.

I tried with Match. The problem is that when it’s turned on, I’m not able to deactivate it only by changing the position of the mouse. I don’t want a clic to be essential to have the result.

I show here where I finished this evening on that particular problem.

Thank you.

Cloud

#P window setfont “Sans Serif” 9.;
#P number 57 354 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 56 326 55 196617 match 1 1;
#P newex 56 379 40 196617 change;
#P toggle 62 417 15 0;
#P number 125 286 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 125 258 34 196617 r clic;
#P newex 42 177 38 196617 r zone;
#P number 55 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 55 256 49 196617 route int;
#P message 42 226 14 196617 1;
#P message 70 226 14 196617 0;
#P newex 42 200 38 196617 sel 11;
#P connect 9 2 8 0;
#P connect 10 0 11 0;
#P connect 7 0 10 0;
#P connect 4 0 10 0;
#P connect 11 0 9 0;
#P connect 5 0 0 0;
#P connect 0 0 2 0;
#P connect 1 0 3 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 0 1 1 0;
#P connect 6 0 7 0;
#P window clipboard copycount 12;

#25961
May 14, 2006 at 8:39am

Hi Cloud

Is this what you mean?
(clicks on mouse only activates toggle if the curser is in the lower right half on the screen and the toggle turns of if the curser is outside the area)

max v2;
#N vpatcher 350 189 1032 798;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 48 23 60 196617 loadmess 1;
#P message 181 255 14 196617 0;
#P newex 181 233 32 196617 sel 0;
#P message 139 159 14 196617 1;
#P newex 139 136 32 196617 sel 1;
#P toggle 181 366 67 0;
#P newex 139 293 92 196617 sel 1;
#P newex 183 186 54 196617 &&;
#P toggle 221 211 15 0;
#P newex 227 160 42 196617 >= 500;
#P newex 183 160 42 196617 >= 500;
#P number 227 137 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 183 137 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 115 42 15 0;
#P newex 144 83 52 196617 metro 20;
#P newex 139 106 189 196617 mousestate;
#P window setfont “Sans Serif” 14.;
#P window linecount 2;
#P comment 420 457 184 196622 Mouse works on lower right part of the screen;
#P connect 16 0 3 0;
#P connect 2 0 1 0;
#P connect 1 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 10 0;
#P connect 3 0 2 0;
#P connect 8 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 11 0;
#P connect 10 0 11 0;
#P connect 1 1 4 0;
#P connect 4 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 10 1;
#P connect 1 2 5 0;
#P connect 5 0 7 0;
#P connect 7 0 9 1;
#P pop;

Morten_E

#77050
May 14, 2006 at 4:27pm

Hi Morten.

Thank you for your send. I can see an other way to construct the code.

What I’m looking for is a little bit different.
I would need the toggle to be on when I clic (ok : it works),
but to come back off just when I release the mouse.
Actually, if I want the toggle to be off, I have to clic another time…

Is it more clear?

Thank you :o)

Cloud

#77051
May 14, 2006 at 4:49pm

Something like this ?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 150 113 46 196617 select 1;
#P message 150 139 14 196617 0;
#P toggle 134 168 15 0;
#P newex 150 89 62 196617 mousefilter;
#P toggle 134 57 15 0;
#P fasten 3 0 0 0 155 162 229 162 229 44 139 44;
#P connect 0 0 2 0;
#P connect 0 0 1 0;
#P connect 4 0 3 0;
#P connect 1 0 4 0;
#P window clipboard copycount 5;

I missed the start of the discussion, so I may have missed something…

hth,

Julien.

#77052
May 14, 2006 at 5:05pm

Hi Cloud

Like this…?

-Morten_E

max v2;
#N vpatcher 350 189 1032 798;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 181 337 40 196617 change;
#P newex 62 223 32 196617 sel 1;
#P newex 62 267 27 196617 int;
#P toggle 79 246 15 0;
#P newex 120 235 29 196617 gate;
#P newex 48 23 60 196617 loadmess 1;
#P message 181 255 14 196617 0;
#P newex 181 233 32 196617 sel 0;
#P toggle 181 366 67 0;
#P newex 183 186 54 196617 &&;
#P toggle 221 211 15 0;
#P newex 227 160 42 196617 >= 500;
#P newex 183 160 42 196617 >= 500;
#P number 227 137 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 183 137 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 115 42 15 0;
#P newex 144 83 52 196617 metro 20;
#P newex 139 106 189 196617 mousestate;
#P window setfont “Sans Serif” 14.;
#P window linecount 2;
#P comment 420 457 184 196622 Mouse works on lower right part of the screen;
#P connect 9 0 17 0;
#P connect 17 0 16 0;
#P connect 1 0 15 0;
#P connect 15 0 16 1;
#P connect 13 0 3 0;
#P connect 8 0 14 0;
#P connect 2 0 1 0;
#P connect 1 0 14 1;
#P connect 3 0 2 0;
#P connect 8 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 18 0;
#P connect 14 0 18 0;
#P connect 16 0 18 0;
#P connect 18 0 10 0;
#P connect 1 1 4 0;
#P connect 4 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 8 0;
#P connect 1 2 5 0;
#P connect 5 0 7 0;
#P connect 7 0 9 1;
#P pop;

#77053
May 14, 2006 at 5:22pm

Hi Julien and Morten.

I’ve finally find the solution with Ggate.

I send you the result of my research and your encouragments!
I combined my solution to your code, Morten.

Thank you very much.

Cloud

#P user gswitch2 162 313 39 32 0 0;
#P window setfont “Sans Serif” 9.;
#P number 191 360 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 148 360 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 191 387 43 0;
#P number 190 267 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 146 188 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 84 88 60 196617 loadmess 1;
#P newex 190 237 54 196617 &&;
#P newex 234 211 42 196617 >= 500;
#P newex 190 211 42 196617 >= 500;
#P number 234 188 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 190 188 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 151 107 15 0;
#P newex 151 134 52 196617 metro 20;
#P newex 146 157 189 196617 mousestate;
#P window setfont “Sans Serif” 14.;
#P window linecount 5;
#P comment 111 468 184 196622 Mouse still works on lower right part of the screen , but toggle comes back off if I click anywhere else!;
#P connect 2 0 1 0;
#P connect 1 0 10 0;
#P connect 15 0 13 0;
#P connect 9 0 3 0;
#P connect 3 0 2 0;
#P connect 11 0 15 0;
#P connect 1 1 4 0;
#P connect 4 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 11 0;
#P connect 10 0 15 1;
#P connect 15 1 14 0;
#P connect 14 0 12 0;
#P connect 1 2 5 0;
#P connect 5 0 7 0;
#P connect 7 0 8 1;
#P window clipboard copycount 16;

#77054
May 14, 2006 at 5:48pm

Ok that’s what you meant. ;-)
I thought you wanted the toggle to switch off when the mouse goes out of the area.

Best
-Morten_E

#77055

You must be logged in to reply to this topic.