a friend of mine asked if max could do 'mouse over' style effects, as in if the mouse is over a specified portion of the screen, either bang to trigger a one off sound, or output a 1/0 to start/end a sound.
I've made some basic mouse stuff to control pitch/amplitude (x, y), sort of theremin-ish, but I'm not sure how to solve this problem. I guess I'd want to make an abstraction that would accept two ranges (x,y), and if the position of the mouse is within both of those ranges at once, output 1.
I am familiar with a lot of max/msp objects, but not jitter or java. I thought of combining some = objects, but that seems rather inelegant. I'm sure [if] would do it, ($1 and $2) being (x, y) mouse position, and ($3 and $4, $5 and $6) being testing range, but I'm not sure of the syntax.
One big problem I've foreseen is that mousestate is absolute, not relative to the patcher window, so that target area will respond differently based on the patchers position on the screen, as well as the screen resolution. I figure this can be fixed by reporting the patcher size, screen resolution, and adjusting the ranges accordingly, or by making the patcher full screen via this patcher and scripting. This seems cumbersome, though.
I'm sure there are a lot of ways to use something like this, especially if the abstraction could be put into a poly~ with different ranges triggering different samples/synths, but I'm stuck here.