SynthMaker

Mouse tracking (and some other stuff)

Archive · 2010 9 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

mwvdlee ·

Here is a little experiment with detecting mouse movement:

It does a number of interresting things: * Display a number of graphics elements relative to the mouse position * Display tooltips near the mouse when over specific controls (this is part of a larger framework which I plan to release in MissingLinks sometime, but it's simple enough to use as is. * Update small screenareas on mouse movement; redrawing the previous area AND the new area in correct order. I'm not entirely sure it'll always work, but so far I have found no issues.

Things it DOESN'T do * Detect mouse movement while pressing a mouse button. You could add a drag module, but then the controls no longer work as should. * Restrict redraws to some reasonable limit based on changes instead of retriggers.

I'm sure you smart guys will be able to improve/expand upon this 🙂

Tzarls ·

Nice! Thanks for sharing. 🙂

infuzion ·

Yea, thanks 🙂

sunsynth ·

Thanks from me 2 🙂 nice Tooltip!

trogluddite ·

That's great stuff. CPU jumps a bit when the mouse is moving, but something like Infuzion's 'heartbeat' trigger/redraw reducer should sort that out no problem.

mwvdlee ·

trogluddite wrote: That's great stuff. CPU jumps a bit when the mouse is moving, but something like Infuzion's 'heartbeat' trigger/redraw reducer should sort that out no problem.

I think right now it's redrawing on every tiny sub-pixel mouse movement, which would be a good explaination of the CPU jumping. A simple limiter may do the trick. I also think the redraw could be a bit faster by adding the areas instead of redrawing them separately (likely there is much overlap).

aliasant ·

This was a great idea that fit right into what Im working on in one of my own projects so I tried to optimize this for speed and portability. For me CPU use when moving mouse fast is down from 12% to 0% 🙂

I joined the 2 modules into 1, both the main mouse tracking and redrawing modules and the string sending modules in each "GUI area" modules. Its not perfect but works better for me at least. I also limited redraws to gain speed without sacrificing to much of the visible smoothness. Check for bugs might be a good idea.....

mwvdlee ·

aliasant wrote: This was a great idea that fit right into what Im working on in one of my own projects so I tried to optimize this for speed and portability. For me CPU use when moving mouse fast is down from 12% to 0% 🙂

I joined the 2 modules into 1, both the main mouse tracking and redrawing modules and the string sending modules in each "GUI area" modules. Its not perfect but works better for me at least. I also limited redraws to gain speed without sacrificing to much of the visible smoothness. Check for bugs might be a good idea.....

I'm not quite seeing the 0% on mouse movement yet. Maybe it depends on the CPU+system. Anyway, assuming it's possible to improve upon 0%, here's a version with the redraw improved; basically a single redraw on every data change instead of two.

I'm not quite fond of how you reworked the tooltip system. The reason I had the separate "retransmitter" is because it makes it easy to retransmit over multiple module depths. The wireless out in the original tooltip "generator" is so you can have multiple tooltip generators in the same module.

aliasant ·

mwvdlee wrote: aliasant wrote: This was a great idea that fit right into what Im working on in one of my own projects so I tried to optimize this for speed and portability. For me CPU use when moving mouse fast is down from 12% to 0% 🙂

I joined the 2 modules into 1, both the main mouse tracking and redrawing modules and the string sending modules in each "GUI area" modules. Its not perfect but works better for me at least. I also limited redraws to gain speed without sacrificing to much of the visible smoothness. Check for bugs might be a good idea.....

I'm not quite seeing the 0% on mouse movement yet. Maybe it depends on the CPU+system. Anyway, assuming it's possible to improve upon 0%, here's a version with the redraw improved; basically a single redraw on every data change instead of two.

I'm not quite fond of how you reworked the tooltip system. The reason I had the separate "retransmitter" is because it makes it easy to retransmit over multiple module depths. The wireless out in the original tooltip "generator" is so you can have multiple tooltip generators in the same module.

Yeah. I had a feeling you made it into 2 modules for a good reason but I couldnt understand it so I made it easy for me. Maybe the ReTransmitter could be like an extra module included but make the basic install as easy and quick as possible. A text can explain what and why the ReTransmitter can be usefull? But still this is your project! Take what you think is useful from my version 🙂 I already have it in my own build working perfectly 🙂

It is possible to lower cpu usage by limiting the triggers even more. I think I set them to 35/sec on both X and Y mouse. Try lowering them to 10 just to see what happens? I have mine on 50 since I don care a much if mouse movements ake it up to 10% or so. As soon as he plugin window is hidden its rocket fast anyways.

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.