DaVinci Resolve with X-touch Mini

Hi Steve,

As you suggested in your email I have started a post in the forum as I think this is something many people are interested in.

I am basically trying to set up the X-touch Mini midi controller to work with DaVinci Resolve and so far have managed to map a bunch of hot keys to the buttons but having trouble with mapping the control knobs. The midi controller has 8 knobs and one fader, I have managed to map the first 4 knobs on layer A to the Lift, Gamma, Gain and Offset using a bunch of positional translators, and mouse wheel control along with a reset button when clicked.

The issue I am having is how to map the remaining control knobs to work with the settings that requite a mouse drag to input their values. I have been through the mouse drag post where you move the mouse to the position then set a timer and input the value but when trying to make it work the mouse cursor seems to wonder up and down the screen and little input happens. A second minor concern if its possible to map absolute values to the control which would be different depending on which control you are mapping. Colour Temp goes from -4000 to 4000, where as Shadows -100 - 100, and Pivot 0 - 1. Thirdly if you change a value is there anyway to cache the previous value you altered and revert back to it by clicking the knob.

Sorry I know its a lot to ask but I am trying my best to get my head around things before I make the purchase.

Cheers,

Andy

Hi Andy,
Are you on Windows PC or Mac? I’m having problems with Davinci Resolve 16 crashing on my PC but if you are on a Mac, I’ll try testing a solution there.

Hi,

Sure, for each knob you will need:

A different X and Y starting position

Perhaps different scaling factor for mouse move (distance to move for every increment or decrement of the knob). You can use a global variable to determine the factor of how many pixels are moved for each increment or decrement.

Perhaps a diffent timer for each knob so that each can have it\'s own scaling or mulitplier.

To retain a value, you will need to store it into a global variable and then refer back to it if you want to snap back to that position.

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

P.S. Davinci Resolve crashes on me so I might be able to help with examples, but perhaps with a different application.

 

 

Hi Steve,

Thanks for your quick response. I’ve been working on it all day and can now attach the file that I’m sort of getting to work. I used one of the mouse drag files from here as a template and went through and changed the up/down to left/right. I’m using DaVinci Resolve that seems to go nuts after a long time in standby. The main issues I’m having now are to do with the values in Resolve not aligning with the knob so I can’t get the full range, as well as trying to figure out how I can click on the knob to reset to the default position both for the knob and the value in DaVinci. Perhaps it is just easier if you look at my bad use of your code. :slight_smile:

Just for reference, my CC values are modified from 0 - 100. So that you don’t have to get DaVinci I can give you the value ranges? The range of values that I need to map for each group are the following:

-4000 - 4000

0-2

0-1

0-100

-100 - 100

If you can figure out a way to do that then that would solve everything.

Thanks

A

Hi,

I decided on a re-write but not sure if you will like it. Instead of multiple translators/presets for each knob, I decided to use the same set of translators for all knobs and use global variables to determine:

1) X Position

2) Y Position

3) Drag Resolution

g1-g8 are the X positions of Layer A knobs 1-8

h1-h8 are the Y positions of Layer A knobs 1-8

i1-i8 are the multiplication factor to move horizontally

I use jX kY and lR for Layer B knobs 

 

In this way you can set all of the initial positions and drag resolution for all of your 16 knobs (8 knobs 2 layers) in one place.

 

Then I have 6 translators. They only fire if it is a legal knob CC1-CC8 or CC11-CC18

1.0 ) First one does the calculations for knob initial positions and drag abount

1.1 ) Second one move the mouse to the start position

1.2 ) Performs a Click Down

1.3) Sets a click up timer

1.4) Performs the drag operation

1.5) On timer, does a click up.

 

They all look at the incoming CC value to determine which variables to act upon (which knob).

Now you should be able to go to translator 0.2 which initializes the all the global variables for each knob. I didn't do them all but left enough so you should see the pattern.

I also added a translator to set your X-Touch MINI to Layer Mode (mine starts in Mackie Mode).

 

I hope the structure helps you. Almost everything should be able to be done by setting the appropriate global variables in the "Init Global Variables" translator and restarting the project (or hitting the ESC key while MT Pro is not focused). The timing of the clicks and drags are still in the translators, however but if you adjust timing for one, it will adjust for all.

On the downside, you might need to document what each does in the rules

 

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


Attachments:
1579826823975_x-touch-mouse-drag-Resolve-2020-01-23.bmtp

Hi Steve,

Thanks for your help with setting up a layout for setting up the knobs. I hate to admit this but as a total beginner when it comes to coding, in general, I am having a bit of a hard time fully understanding everything. I get it that you have set up a template where I can just add in the x and y positions for where the mouse has to be and how I can set a value for the sensitivity, plus a value for making the knob reset to the center which I’ve corrected to 51.

The issues I’m still trying to solve are that if it is possible I’d like the dial to match the values in Resolve, for example with color temp it goes from -4000 to 4000, so as my knobs value is set from 0 - 100 is there a way to make it match the lights on the dial so I know how far it’s gone? Also instead of it defaulting to the center as soon as I have turned it, can it do that when I have clicked down the knob to reset the value say by it clicking the mouse, entering a value of 0 and pressing return? The only other issues are with the panels, as on the color wheels page you have to click either 1 or 2 to get the adjustments controls to come up. Clicking the one tab lists contrast, pivot, sat, hue and luma mix. Tab 2 is Temp, tint, mid-tone detail, color boost, shadows, and highlights.

Anyway, I will keep updating the template and try to combine it with the main set up for the other controls. I’m really curious if the above is possible or too complex.

Cheers,
Andy

Hi Andy,

The issues I\'m still trying to solve are that if it is possible I\'d like the dial to match the values in Resolve, for example with color temp it goes from -4000 to 4000, so as my knobs value is set from 0 - 100 is there a way to make it match the lights on the dial so I know how far it\'s gone?

So you want to change from a range of 100 (0-100) or perhaps a range of 128 (0-127) to a range of 8001 (-4000 to +4000)

Here is a forumla you can try that should set the scale correctly (or close) for you. Note that since MT pro does integer arithmatic rounding to the next full value is automatic.

So given an input value of pp

qq=pp*128 (encoder range)

qq=qq/8001 (value range)

qq=qq+64 (offset since value range starts negative the 1/2 way point is 0)

If you analyze this you will see that for every 1 click you need to move 8 values. So use a factor of 8 for this control and it should work (if I did my math right). (PS Actually every 8 clicks is move of 500).

 

Also instead of it defaulting to the center as soon as I have turned it, can it do that when I have clicked down the knob to reset the value say by it clicking the mouse, entering a value of 0 and pressing return?

If you are asking if you can if you can enter a number after click, then yes. Do a click down and up, then a delay and then send the keystroke 0 followed by a return on a different translator.

The only other issues are with the panels, as on the color wheels page you have to click either 1 or 2 to get the adjustments controls to come up. Clicking the one tab lists contrast, pivot, sat, hue and luma mix. Tab 2 is Temp, tint, mid-tone detail, color boost, shadows, and highlights. Anyway, I will keep updating the template and try to combine it with the main set up for the other controls. I\'m really curious if the above is possible or too complex.

Yes, programming mouse clicks and making sure the accuracy and timing is right for your application is probably one of the most tricky things to program. The accuracy and timing needs to be perfect. If you error on timing make it slower than faster so the application can keep up.

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

Hi, Andy,

Have you found a solution yet? I have the same intention. But since I have no knowledge in programming at all, it would be great if I had a template. Can you help me with the code?

Greetings,

Johannes