Midi to mouse movements but only when mouse is in position

Hi, i’m super new to Bomes.

Currently i’m using MTP to convert midi cc to a mouse position and either a middle wheel scroll or a mouse click and drag.

My question is, currently sometimes when using the above translations, the mouse hasnt moved to its new location before the mouse click and drag or middle wheel is scrolled. I’ve tried playing around with adding delays but still seem to occasionally have this happen. Is there the ability to use something like a rule to check the mouse position, if its not in the correct place, to exit out of the translator? Is it the most efficient way to to scroll over a specific area of the screen and have this repeat for every CC message from a particular encoder? In my mind there is potentially a lot happening if i was to turn the encoder super quickly.

All thoughts and guidance welcome!

Thanks

Hi,
MT Pro cannot natively determine the mouse position but if you are on Windows, I have a written a program called MIDIBuddy that looks at Windows mouse positions and sends this information via MIDI to MT Pro via SysEX so that MT Pro can be aware of the mouse position.

Other than that you would have to indeed send delays and trust that the computer is responding correctly to mouse movement commands from MT Pro.

The process for move and drag with a knob is.

  1. trigger a move and click down when starting to move the knob (if you haven’t already started the sequence)
  2. trigger a timer to set a global variable and a watchdog timer so that the step above does nothing unless the sequence times out.
  3. With a delay send another move command based on the movement of your knob (drag)
    Continue drag movements as long as the knob is moving and keep the watchdog timer running by retriggering it.
  4. When you stop moving the knob, the watchdog timer triggers to send mouse up click message and resets the global variable.

The attached is an example, using a relative encoder (2s compliment). This type of encoder sends +1,+2,+3 … MIDI values for clockwise, depending on how fast you turn the knob and sends 127,126,125 … MIDI values for counter-clockwise movements…

mouse to knob drag-relaative-twos-compliment-2021-02-07.bmtp (3.5 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thanks for the advice Steve, super helpful!!

I’ll take a look at everything you’ve mentioned as well as midi buddy too.

Would it have much affect using an encoder thats sending 1 for anti clockwise and 127 for clockwise?

Thanks

Hi, I’ve never seen an encoder that sends 127 for clockwise and 1 for counter clockwise, but if you do, changing the rules in translator 0.1 should do the trick:

From this (note I had 65 instead of 64 in the project file

if qq>64 then rr=128-qq
// the below is incorrect in the project file and says 65
if qq>64 then rr=rr*-1
if qq<64 then rr=qq

For reversing it would look like this

// Reverse polarity
if qq<64 then rr=qq*-1
if qq>64 then rr=128-qq

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz