knob to mouse movement

  • Forum
  • knob to mouse movement
0
0

Hello,

 

I’m trying to use the dj tech tools midi twister with Bome to control some settings in davinci resolve. I took inspiration on some threads. I made some translators so when I push the button, the mouse click on a position. Then when I turn the knob to the left the cc is value 63 and when I turn to the right the cc value is  65. When cc is 63, mouse move to the left by 2 pixels. When cc is 65, the mouse move to the right by two pixels. I made a timer so the mouse clic is up after 500 ms. Here are the translators:

[x] Translator 3.0: Mouse Move Click Down
Options: swallow
Incoming: Control Change on ch. 2 with CC#:1 (0x01) and value:127 (0x7F)
Outgoing: Left mouse button down at 655,611

[x] Translator 3.1: Mouse Move Drag LEFT
Options: swallow
Incoming: Control Change on ch. 1 with CC#:1 (0x01) and value:63 (0x3F)
Rules: g1=2
Outgoing: Mouse move -2 (left) , delay:0 millisec

[x] Translator 3.2: Mouse Move Drag RIGHT
Options: swallow
Incoming: Control Change on ch. 1 with CC#:1 (0x01) and value:65 (0x41)
Rules: g1=2
Outgoing: Mouse move 2 (right) , delay:0 millisec

[x] Translator 3.3: Mouse Up Timer
Options: swallow
Incoming: Control Change on ch. 1 with CC#:1 (0x01) and any value
Rules:
if g1!=2 then exit rules, skip Outgoing Action
gc=1
Outgoing: One-shot timer “mouse up 2”: 500 ms delay, delay:150 millisec

[x] Translator 3.4: Kill Mouse Timer
Options: swallow
Incoming: Control Change on ch. 1 with CC#:1 (0x01) and any value
Rules: gc=2
Outgoing: (none)

[x] Translator 3.5: Mouse Up Timer
Options: swallow
Incoming: Control Change on ch. 1 with CC#:1 (0x01) and any value
Rules:
if g1!=2 then exit rules, skip Outgoing Action
if gc==2 then exit rules, skip Outgoing Action
Outgoing: Kill timer “mouse up”

[x] Translator 3.6: Mouse up
Incoming: On timer “mouse up 2”
Rules:

gc=0
Outgoing: Left mouse button up

 

Are this settings corrects? I’m not sure to understand correctly the variables and the timer. It works but I would like to be sure. I duplicate this preset 3 times for other knobs and positions. Should I make unique variables and unique timer name by preset? gc, g1, timer1 in preset 1, then gd, g2, timer2 in preset 2 and so on? Of course when I turn one knob, the same timer and variables are active on all the presets, so the mouse click up 4 times because the variables and the timer are the same thru the presets. It works but maybe it takes some ressources for nothing..

 

Thanks for your help

 

Vincent

 

Marked as spam
Posted by (Forum: 1, Answers: 3)
July 26, 2019 2:55 pm
72 views
0
Private answer

Hello Steve, thanks a lot! It’s almost perfect. so I need only the knobs 1-2-5-9-13. I noticed that if I click with knob 1 for example, do my thing, then after  I can click and turn with the knobs non-assigned  to the last position set. I could set those rules to the 1st, 2nd preset and the first translator of the timer preset. But maybe there’s a math simpler than that:

if ha<1 then exit rules, skip Outgoing Action

if ha==3 then exit rules, skip Outgoing Action

if ha==4 then exit rules, skip Outgoing Action

if ha==6 then exit rules, skip Outgoing Action

if ha==7 then exit rules, skip Outgoing Action

if ha==8 then exit rules, skip Outgoing Action

if ha==10 then exit rules, skip Outgoing Action

if ha==11 then exit rules, skip Outgoing Action

if ha==12 then exit rules, skip Outgoing Action

if ha>13 then exit rules, skip Outgoing Action

Marked as spam
Posted by (Forum: 1, Answers: 3)
July 29, 2019 2:05 pm

You can make the rules to only accept specific knobs, that way you would only have 5 instead of 10:

if ha==1 then exit rules, execute Outgoing action

// Other execute conditions here

// anything else fails
exit rules, skip outgoing action

—-
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

( at July 29, 2019 3:59 pm)

If I do that, if ha==1 it exit rules, so the rules for the position under that are not taken in consideration?

Thanks

( at July 30, 2019 10:12 am)

Exit rules (EXECUTE OUTGOING ACTION). It will work. It only SKIPS OUTGOING ACTION if the rules fall through to the end.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

( at July 30, 2019 5:12 pm)
0
Private answer

I cleaned up your timer routines a bit (eliminating 2 translators). I also use the variable gb to determine if the knobs will move the mouse. if gb!=1 (click down is not active) then we don’t move the mouse.  The variable gb is set to 1 when clicked and back to 0 when the up click message is sent.

 

Attachments:
Marked as spam
Posted by (Forum: 42, Answers: 3461)
July 26, 2019 7:58 pm
0
Private answer

Hi,

First made only one  Preset and Translator for mouse movement since they are al relative movements, that is all you need. I used any CC value.

I added a rule to ensure the same knob is moved so that if you click one knob and move the next, nothing will happen. In your case you are using the same CC for knob clicks and movement, but just on different channels so that maps out really well.

That’s it.  Good job for a newbie!!!

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

if pp!=ha then exit rules, skip outgoing action

Attachments:
Marked as spam
Posted by (Forum: 42, Answers: 3461)
July 26, 2019 7:35 pm

Oh and if you only want the knobs to move the mouse after a click and before the timeout, you can set another global variable to 1 when you click and then turn it back to 0 when the timeout fires. Then you can add another condition in your movement translators to look at that same variable and if not set, skip outgoing actions.

( at July 26, 2019 7:38 pm)
0
Private answer

Hello Steve,

 

thanks you answer. No the values I want to change are in the color page. I attached a picture of the values.

I attached also the project with what I understood of your advices. It it what your were thinking?

I don’t understand how to do the last part, I’m quite new to Bome:” may want to qualify the CC# for knob movement as well so that if you bump (move) an adjacent knob after the initial click, it doesn’t do anything.”

 

Bests,

Marked as spam
Posted by (Forum: 1, Answers: 3)
July 26, 2019 4:54 pm
0
Private answer

Hi Vincent,

Thanks for your question!

First of all, if you are trying to control faders on Davinci Resolve,  I think it will let you use Mackie MCU mode and then you could do everything for Mackie MCU knobs and faders using MIDI instead of mouse movement and click, which might be more reliable, especially if screen coordinates change (by moving or sizing the Resolve window).

If we used MIDI instead of mouse movements, we would need to convert CC messages to MCU supported messages and you could see a tutorial on that that I did for Premier Pro.  The only difference is  that I believe Davinci Resolve requires fader touch and release messages so the project file would need to be modified somewhat.

Anyway Mackie MCU emulation is a different subject so, if you want to stay on the current path with mouse control, read on.

In looking at your translators, it appears the only real differentiation needed between knobs would be the initial mouse X,Y position and the incoming CC number (as long as you are using only knob at a time). You could assign each of these as global variables and in rules determine the initial mouse X,Y position by the CC number you are using.  So assuming you use hx,hy for mouse position x and y and ha for your incoming CC number you could have a rule like this:

Incoming: Incoming CC on MIDI CH2 any CC set to ha and value is 127

Rules:

// In this example only allow for CC1-CC5//

if ha<1 then exit rules, skip outgoing action

if ha>5 then exit rules, skip outgoing action

if ha==1 then hx=655

if ha==1 then hx=611

if ha==2 then hx= 490 (or whatever y valye you want for CC2)

if ha==2 then hy= 560 (or whatever y value you want for CC2)

The outgoing and timers can then be used for all CC #s since the mouse movement is relative to the initial click position and you would only use timer for the current knob you are moving.

You may want to qualify the CC# for knob movement as well so that if you bump (move) an adjacent knob after the initial click, it doesn’t do anything.

 

 

The other translators would be similar incoming actions with any cc and then rules to qualify the CC number you are using.

 

Hopefully you get the picture from here.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Marked as spam
Posted by (Forum: 42, Answers: 3461)
July 26, 2019 3:36 pm