APC-40 - Davinci Resolve Mouse Drag

I tried setting up a knob on the APC40 with using one of the templates i believe it was update 04 the knob captures the mouse and clicks but no movement up down or left right.

Hi, I moved this into a new topic since you are asking about APC-40 instead of MIDI Fighter Twister. If you can post the project file, you are working with I can have a look at it. Keep in mind that the Midi Fighter Twister is quite different than the APC-40 in that you can program the MFT to send relative encoder values where you can’t with the APC-40. The only relative encoder on the APC-40 is the Cue Level and even it is different than the relative mode of the MFT.

If you want to see more of what is happening, you can check “Outgoig” and “Rules” in the Log Window. Rules will show each rule executed for a given translator and outgoing will log non-MIDI related things like keystrokes, mouse movements and clicks.

If you post your project file, I can take a quick look for you.

Steve Caldwell
Bome Customer Care


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

its under preset Color Wheel knobs.On the APC40 this is the top left knob of the group of 8 Resolve APC40.bmtp (10.3 KB)

OK, since this is an absolute encoder, we need to convert the absolute value to the relative value of the last known position to calculate how to move.

current cc value is global variable gb
last known cc value is global variable gb

These will need to be different for each knob.

We determine the movement amount by subtracking gb from gc

Then we start the timer click/drag operation.

I continue to use ga to determine the state of the watchdog timer (so we don’t repeat clicks).

I added another preset “Init” with a translators “Initialize Global Variables” that both sets things up initially and keeps straight the global variables you are using.

The translator is triggered by the “Init” timer which is triggered by opening the project or pressing the computer ESC key.

These are the key rules in translator 10.3 that determine mouse drag movement amount

if gb==gc then exit rules, skip Outgoing Action
pp=gb-gc
pp=pp*10
// Set for next iteration
gc=gb

Resolve APC40-sjc.bmtp (11.3 KB)

Steve Caldwell
Bome Customer Care


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

I will check it out thank you very much. This is the last control i need to figure out. After that i need to figure out how you did the HUD.

Do you mean HUI? Not sure what HUD is (Heads up display)?

Yeah on the Beat step i saw a video on HUD but it says for Beatstep and APC40. The bmtp file you sent it clicks the cursor and if you turn the knob it moves up but not down and if you move it back and forth it eventually stays at the top.

I got the capture and movement to work you have to have the knob position so the led is point at 12 o clock position and everything moved fine. So i duplicated the Translators you had on the file… To make a left and right knob. but once the cursor gets captured it only moves up and down i change the x y settings opposite. Resolve APC40-sjc.bmtp (13.0 KB)

OK, it turns out that the APC-40 keeps sending 127 after it goes far right and 0 after it goes far left so this version should work better and not need centering.

Resolve APC40-sjc-a.bmtp (11.8 KB)

If you want it to go left/right instead of up/down, then put the mouse movement variable in the first box and leave the second box 0 instead.

image

If you want the direction reversed just put the following as the last line in rules

pp=pp*-1

Steve Caldwell
Bome Customer Care


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

Ok thanks now if i want a second knob i just have to duplicate all these translators and then change to left and right.

And use different global variables for the new knob and a different timer name.

Steve Caldwell
Bome Customer Care


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

Ok thank you very much your great for support. I will try to add second knob.

Ok i test it out and it works great…I change mouse click to set position so i could set up the other wheels on there own knobs and it grabs the cursor but doesnt move just flickers in place. Any ideas why

You probably missed one of the global variables. For the first set of translators we use ga, gb, gc and gd so for these ones use ge, gf, gg, and gh.

Change ga to ge, gb to gf, gc to gg and gd to gh. Look at the rules of all translators within the new group.

Steve Caldwell
Bome Customer Care


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

Thank you for the help i got all 8 buttons working for the 4 color wheels

Awesome. Enjoy!

Steve Caldwell
Bome Customer Care


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

I have one knob on the apc40 the cue knob that i want to move the cursor horizontally. ive tried to copy setting from the other knobs but it doesnt seem to work… if it turns right its value is 1 no matter how much i turn it and if i turn it left the value is 127 consistently

Cursor Move Horizontal.bmtp (657 Bytes) .

Hi,

This knob sends 1,2, 3 … for right turn relative and 127, 126, 125 … for left turn

So the rules would look like this

Incoming CC # (whatever CC it is ) on MIDI CH 1 value qq

// For positive movement
tt=qq

/ For negative movement
if qq>0x40 then tt=128-qq
// Make it negative
if qq>0x40 then tt=tt*-1

Now qq will have the relative mouse movement

multiply if it is too fine

qq=qq*10

Steve Caldwell
Bome Customer Care


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

I did all the above programming and the cursor only moves Right so positive not Left. This knob only sends 1 or 127 no matter how much you turn it either direction. As long as im turning one direction or the other it logs 1 or 127 not 1 2 3 or 127 126 125

This should do it.

Final value in tt not qq

// cue knob if turned right gives a value of 1
//cue knob turned left gives a value of 127
// For positive movement
tt=qq

// For negative movement
if qq>0x40 then tt=128-qq
// Make it negative
if qq>0x40 then tt=tt*-1

//Now tt will have the relative mouse movement

//multiply if it is too fine

tt=tt*10

Cursor Move Horizontal-cue-level-sjc.bmtp (1.4 KB)

Steve Caldwell
Bome Customer Care


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