Resolve and changing screen resolution

I am currently writing code for running Davinchi Resolve via my Loupedeck Live by using its MIDI options.

I get everything to work and have managed to to pull off hundreds of commands.

However I need to figure out how to port this to other resolutions.

I am currently on Apple MBP 16 running at 2048x1280 (perceived) aspect ratio of 16/10. However I know that all my button clicks and mouse moves will get all messed up when I switch to a UHD that my PC uses 3840x2160 with aspect ratio of 16/9 or the 2560x1440 that my home external monitor uses.

So my question is is there a smart way to scale x and y positions so I only need to hunt them once?

I have tried setting global variables and then recalculating yx and yy (my global coordinates) by using xs and ys (global scale factors per project). Where by project I mean screen in practice. But never the less I still get bad positions.

I also do all the math with x1000 as to mitigate the fact that Bome only works with integers for output.

I know all of the above can be done as I have the MIDI grade 4 software and the DJ Tools Twister and that works with Resolve on various screens.

Thank you for the help.

It should work however as you said, you might have to be careful with the math.

I would suggest to reduce rounding errors, you start by multiplying everything by 1000
When you are done with the math, divide the results by 1000 to get you back to the original proper scale.

The same with rules for screen coordinates. Multiply, do the math within the rules and then device and then use the results for the mouse positions.

I’ve never done this type of endeavor, personally however it should work, with the 1 caveat. Resolve may have it’s own logic for positioning controls on computers with different aspect ratios, so maybe this is the problem. In that case you would probably either need to hardcode for different aspect rations (unless you can reverse engineer how it is done in Resolve).

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: