lcd: drawsprite vs lineto

kodamapixel's icon

I've been toying with using a simple Max patch to record on screen mouse movements over time, similar to these: http://iographs.com/

To start, I've tried using the [lcd] object, but found that it's not super happy about tracking the mouse when the patch window isn't in the foreground. To get around that, I put in [mousestate] into a 'lineto' message. This seems to work pretty well, but the line it draws is noticeably jagged.

Instead I tried [mousestate] into a 'drawsprite circle' message. This gives me a nice line, but stops working as soon as the patch window isn't in the foreground. Aside from that, I didn't make any changes. Is there something about 'drawsprite' that requires the window to be in view?

Max Patch
Copy patch and select New From Clipboard in Max.

I've been running the following patch in Presentation Mode, to track the entire screen (mine happens to be 1920x1080)...

kodamapixel's icon

Thought I'd give this a little nudge... Has anyone had a chance to test the patch? Even if there isn't an answer to my question, I'd be interested to know if someone else can confirm the behavior.

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

you could use slide to smooth the jaggedness, but it creates a sort of latency--

you could get around this by sensing when the mouse stops after a certain amount of time and then with a metro banging a zl reg which contiains the most recent mouse position... a bit of a clumsy idea admittedly...

kodamapixel's icon

Thanks for your suggestions, Terry. After giving your ideas a try, I found that I'm getting some kind of interference between the normal mouse-drawing-behavior of the [lcd] and inputting 'lineto' coordinates via [mousestate]. This screenshot is hopefully a better explanation than my rambling:

Max Patch
Copy patch and select New From Clipboard in Max.

...what I think is happening is when the patch window is in the foreground, I'm getting smooth mouse drawing. When it isn't in the foreground, the [lcd] is remember the last coordinate of mouse drawing, but then jumping between that and the incoming [mousestate] coordinates, creating the (admittedly kind of cool) triangular shapes.

3921.ScreenShot20120523at8.50.jpg
jpg
Floating Point's icon

that's because you're sending the lcd two lineto messages-- one from the metro->mousestate and one from the lcd itself-- and you don't have the slide objects in there either...

kodamapixel's icon

Ahh, so that was embarrassingly simple: I was taking the idle mouse coordinates into the [lcd] and the slow metro into the [mousestate] was giving me the jagged lines.

Max Patch
Copy patch and select New From Clipboard in Max.

Thanks again for your help, Terry.