How Would I Recreate This?

Hello,

Could anyone tell me how I could recreate this with a MIDI controller?

https://youtu.be/WK94pop46xA?t=17

From here to around 42 seconds is what I need. I would like to recreate this with my Arturia Beatstep.

Right now I'm on mac OS version 10.15.7, but I would like to do it with my M1 MacBook in the future as well.

I could set my MIDI to a setting where it sends out a value between 0 and 127, and where it sends out a value of 65 each time I turn it right, and 63 each time I turn it left.

I'm quite new to Keyboard Maestro, and have no knowledge of scripting (though I'm willing to learn).

Thanks a lot in advance!

1 Like

Hey @klok,

Try searching the forum for "midi" and see if you find anything useful.

-Chris

Hello @ccstone ,
I've done that, Set a Variable Using Raw MIDI Packets , this article seems interesting, but I don't know how packets work, so I don't know if this works for me...
I've also figured out that I have to go and use the 'HUI protocol', but I don't know how to set that up either...
If someone could help me with a basic HUI protocol, I think I might get a lot closer to what I want, so that would be great!
Thanks!

Not very many people are working with MIDI on the forum. I hope one of them jumps in, but don't hold your breath...

If you just do a google search you'll get this on the HUI Protocol: I FREAKIN FOUND THE HUI DOCS!!!!! - Cockos Incorporated Forums

Read the PDF linked to there.

2 Likes

Thank you :slightly_smiling_face:
I've read (and tried to understand) it.
Unless I'm missing something, I think the document tells me what the numbers mean...
Now I have no idea what I can do with those numbers to recreate mouse movement.
Would you be able to help me @tiffle ?

Fraid not @klok - I gave up experimenting with MIDI years ago (and never with KM) so I'm not in a position to offer anything useful; all I'm good for right now is to say this:

Well - MIDI is all about sending data packets between controllers and instruments so if you want to conjure up something that's specific to you then you need to understand MIDI at its lowest level. If you really don't know MIDI you have a hill to climb.

Hopefully, someone more recently involved will chime in.

1 Like

What exactly do you want to control with the Arturia Beatstep knob?

If you click the youtube link in my original question, you will find exactly what I need :slight_smile: For that usecase as well (Davinci Resolve).
I've looked at your post as well, it looks similar to what I need, so it could be useful. I've downloaded your macro shared there, but I don't really understand what the variables do yet, so I haven't figured out how that macro would make my mouse move yet.

To put into words what I need:
I need my mouse to click somewhere, hold it, and drag it left (and right) the further I turn my knob, then release.
Problem right now is: My knob sends out individual instructions for each bit I turn it (But I haven't explored packets too much yet).

I've thought about holding a button to make my mouse move to a location, click and hold, and then use my knob to move the mouse left and right, but I haven't been able to make that work yet. Maybe someone has a working solution for that?

Thanks in advance!

One last question for you: Does this mean it could literally make a package of instructions, and send that into KM:
If I turn my knob 90 degrees right, could it send an instruction to move my mouse right further (with one macro) than if I had turned my knob 40 degrees to the right?

First off, your Arturia Beatstep knob is a controller so it actually generates MIDI packets so you’d need to get KM to receive and act on that data by using a KM MIDI trigger to trigger a KM macro - see the KM wiki trigger:MIDI [Keyboard Maestro Wiki]. Your triggered KM macro could then move the mouse, although what that actually does to your DAW is up to you to arrange.

Edit:
Did you see this by the way? DaVinci Resolve 17 Hardware Midi Controller Arturia Beatstep Demo - YouTube

I had read that, but now that I know a bit more about what sysex and hui protocol means, this makes a bit more sense :slight_smile: Thank you.

I've seen it, yes! This guy bought it from someone, and that project inspired me to make my own as well. Problem is, he made it in 'controllermate' which is not compatible with the new m1 macbooks. KM is, so I'm trying to do it in KM.

When looking at the MIDI trigger article, I'm still not quite sure what the difference is between a controller change trigger, and a RAW packet trigger, and how I could use a RAW packet to my advantage. I feel like the solution lies there, but I have some learning to do first.

Any help is appreciated!

2 Likes

Maybe you should start by creating two variables that change depending on what KM receives:

  • TurnKnobLeft: Triggers KM, which then sets MidiReceived to 0
  • TurnKnobRight: Sets MidiReceived to 1

Then:
If MidiReceived = 0
Set MidiChanged to -1

Else:
If MidiReceived = 1
Set MidiChanged to +1


In another macro, you create a calculation:
NewMidi = CurrentMidi + MidiChanged

Oh.. OK.
HUI protocol is not the right way to go about this afaik, I had a quick look in DaVinci's manual it seems it's aimed at the "Mixing" Audio side only, it's not really meant to be used for the color grading controls. So.. You don't need to learn anything about packets, regular MIDI CC will do you just fine and it's way simpler to deal with.

I can't tell you how to do it the right away as I am also just learning KM but I can point you in the right direction and give a working example.

1 - Use whatever software the Beatstep device has for MIDI configuration and set a Knob to "Relative" Mode (MIDI devices are usually set to "Absolute Mode" by default), this makes the knob only send 2 messages: 1 and 127 when you rotate it and it also allows it to continuously send those 2 values as you keep rotating.

Now just make a new Macro, set the trigger as MIDI and learn one of the knobs direction (will be either 1 or 127). I have a Komplete Kontrol MIDI Keyboard which is similar to yours:

2 - MIDI knobs can very easily overwhelm KM, so you need to use a "Semaphore Lock" on your Macro, click the gear icon and "Set Action Timeout" to 1 hundred of a second, and disable "Notify on timeout". If you skip this step things will get out of hand real fast.

3 - Add a "Move and Click" action at the current mouse location and add a few pixels horizontally "relative to the current mouse location" and add a "Release Mouse button" action.

Now everytime you twist the knob in that direction KM will click and drag the mouse the number of pixels you picked. For the opposite rotation do another Macro and just set it to drag horizontally for a negative amount of pixels. (-8 in my case, 4K screen so 8 pixels is not very much)

Unfortunately executing this feels rather slow even with only a 1 hundred of a second semaphore but it works. You can do more complicated things like storing several positions on screen and whatnot like that device on the video you linked but before getting to that point you gotta find a way to do the simple mouse drag without it being so laggy... Someone more knowledgeable has to help with that.

I'll attach these example Macros for you to have a look.
MIDI MOUSE MOVE Macros.kmmacros (12.6 KB)

3 Likes

Thanks everyone!

I'd been puzzling yesterday, and before I saw these replies I found a solution myself:


I made a button which toggles a variable on or off (coincidentally, sort of what @hello suggested). If the variable toggles on, it also activates this macro:

I had tried this method before, but that didn't work because instead of using a pause, I engrouped the click and hold in an 'until' group, which activates the click over and over, whilst the pause makes it so that it only clicks once.
The click also holds down, so if I were to move my mouse it would drag the dial it clicked on.

Then, I made a simple macro which moves my mouse left and one that moves it right, when I turn a knob:



The knob is set to relative, like @D-One suggested :slight_smile:
(You can also make it move up and down, for other usecases)

Now to improve this macro I'd like to activate the toggle, move and click when I turn my knob, instead of having to push a button first. (I will have to create a button to toggle the variable off though, since KM can't know when I feel like I finished adjusting). I'll take a look if @hello 's and @D-One 's suggestions help with this.

Thanks everyone for your help! I guess I'll post another reply if I do manage to improve it.

3 Likes

I optimized it, sort of (to my liking).
Before, I used a button to select which value I wanted to control in Davinci Resolve, and then I had 2 knobs for moving the mouse up and down. This meant I used 9 out of the 16 buttons, which left no space for other shortcuts.

In my new solution I have one knob for each value I want to control. Then I have one button to stop holding the mouse (so I can start turning another knob). This does mean I have a lot more macro's in my KM maco group.

Anyway, here it is:


This macro activates when I turn my knob left (counter clockwise). I duplicated this macro and changed the 63 to 65, for when I turn my knob right (So I have 2 macro's doing the same thing).
NOTE: The activation is set to "changed to", and NOT "changes to", this means it will only activate once, and not activate every time you turn it a bit.

Then it checks if my variable is set to false (if it were true, it's already in use for another value). If it's false, it sets the variable to true, then clicks on a location I set (1 location for each value I want to control), and holds until the variable is set to false again.

To do this, I use this macro:


It's a simple macro which only sets my variable to false, activated when I press a button on my MIDI.

While the variable is true, I use the same knob to move my mouse left and right (1 macro for each direction):


This time the activation is set to changes to, so it sends out another instruction each time you turn it a bit.

Using this configuration I have 4 macro's for every value I want to control in Davinci Resolve, but it works without lag.
The only thing is: if controller 9 was last turned right(changed to 65) before I stopped holding it, I have to turn left(changed to 63) to activate the macro again, but obviously after that I can simply turn right again to change it the way I want it.
This is not really an issue for me, since it works for me perfectly aside from this.

I hope someone found this information helpful :slight_smile: