Forums > MaxMSP

is there a mouse on object/function/external?

August 4, 2008 | 9:26 pm

hi, i’m trying to build a plugin and i’d like to keep sending a value with a slider (or whatever object) even if my mouse doesn’t move from the slider. Don’t want to use turnarounds (metro for example). Is there a mouse on function/object?
Thanks
Alberto


August 4, 2008 | 10:21 pm

This seems not very clear. Could you explain.


August 4, 2008 | 11:54 pm

There’s no handy object like that that I know of, but if there were, there would be something similar to a metro built into it so you might be better off just using a metro.

However, you could also turn the value into a signal, then turn it back into a float, then use to gate the output whenever the mouse is not clicked. But you still need a metro for the object i think…

For example:

– Pasted Max Patch, click to expand. –

August 4, 2008 | 11:56 pm

oh, sorry, you don’t need a metro for and i forgot to put it in that last patch.

here’s the whole thing:

– Pasted Max Patch, click to expand. –

August 4, 2008 | 11:58 pm

It appears that you do need to send mousetate at least one bang to get it started, though, so you might want to attach a loadbang to it.


August 5, 2008 | 1:10 am

Not quite sure what you mean there. For some sort of "hover" or "on" reporting, transparent buttons (ubuttons) work, so do pwindows, and there’s the new hover object (but only for mouseover, not for coordinates). The mousestate is also useful, but may take more resources, not sure. I’d go with a ubutton over your slider or whatever else you’re working with. Though I’m still a little confused as to what you’re looking for:

"i’d like to keep sending a value with a slider (or whatever object) even if my mouse doesn’t move from the slider"

do you mean "doesn’t move ON the slider"? So if it’s stopped and not clicked, the data stream continues. If that’s the case, then yes, you probably need some kind of metro somewhere. The ubutton and pwindow will give coordinates, but only when they change. Just set them into ints, then bang out at whatever update rate you want.

You could also move the slider to set the value of a sig~, which can then output float values of its level. These continue while audio is on.


August 5, 2008 | 8:23 am

Thanks everyone, i had to be more clear i agree. I have a patch doing some automatic and random audio glitching (downsampling, pitching, shuffling parts, repeating, etc…) autechre style. But i want top have some manual control, so when i touch some buttons, sliders, etc, the patch should redirect attention to what i’m doing and not listening to the randomly generated parameters. I already used a metro to do this. When i stop using the buttons the patch goes back to random mode. But it goes back to random mode also when i’m on a stable value with the mouse (so i’m active on the patch) and i don’t move, and i don’t like that. That’s why i wanted a better way to do the trick. I’ll probably go for the mousestate object, it seems what i was looking for. Rabid, i have max 4.6 so i cannot read your patch, is it possible to have it in 4.something so i can check it?
Thanks all
Alberto/JesterN


August 5, 2008 | 9:31 am

Here you go, not sure if it’s what you want but maybe you can tweak it to your liking:

#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 302 105 166 196617 < -Loadbang needed to start mousestate reporting mouse-clicks;
#P window linecount 1;
#P comment 290 189 45 196617 < -Result;
#P comment 272 84 100 196617 < -2. Change slider;
#P user ezdac~ 193 34 237 67 0;
#P newex 255 105 48 196617 loadbang;
#P flonum 255 188 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 255 168 29 196617 gate;
#P toggle 255 148 15 0;
#P newex 255 129 66 196617 mousestate;
#P flonum 188 141 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 157 142 15 0;
#P user number~ 128 123 167 138 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 128 103 29 196617 sig~;
#P user hslider 128 82 18 128 128 1 0 0;
#P comment 237 43 100 196617 < -1. Turn on ezdac~;
#P connect 10 0 6 0;
#P connect 8 0 9 0;
#P fasten 5 0 8 1 193 165 279 165;
#P connect 7 0 8 0;
#P connect 6 0 7 0;
#P connect 3 1 4 0;
#P fasten 3 1 5 0 164 138 193 138;
#P connect 2 0 3 0;
#P connect 1 0 2 0;
#P window clipboard copycount 15;


August 5, 2008 | 9:38 am

Thanks Rabid i think this is exactly what i needed!
Cheers
A/J


August 5, 2008 | 6:05 pm

Actually i figured out that mousestate holds for an entire patch, even across patches, and what i wanted was something related to a specific object, i have to use metro then!
A/J


August 5, 2008 | 6:17 pm

Ya, you’re better off with metro, otherwise, you could also use mousestate’s mouse-position output to track the exact position of the fader then gate the output only when it falls within certain coordinates(using "mode 1" or "mode 2" of the object; see help-file). But it seems like it’d be much more work, depends on what you’re after, i guess.


August 6, 2008 | 3:03 pm

alberto novello schrieb:
> Actually i figured out that mousestate holds for an entire patch,
> even across patches, and what i wanted was something related to a
> specific object, i have to use metro then!

No, you have to use the location information of mousestate, to determine
where it is… If its above your control, gate the flow. if its
somewhere else ignore…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


August 9, 2008 | 1:28 am


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