One-key macro

Is it possible to create a macro in Cubase that associates only one key with two commands?
Ex. Key “A” to show and hide the automation.

Some of the Key Commands are toggles between 2 states. I think if you search the KCs for “toggle” it will find them all so you can see what’s setup that way. It’s pretty hit & miss. But there is no way to setup a macro like that for an arbitrary function.

What specifically do you want to achieve?

Exactly what I gave as an example: A macro to use the A key to show and hide the automation of a track.

Unfortunately, these are two separate commands and it’s not possible to set this up via macro.

However, if someone was looking for an excuse to buy a Stream Deck you can set it up to toggle commands on button pushes.

Macros in Cubase are pretty limited because they don’t have any logical control structures that you’d need to use them to build scripts. For some stuff you can use the Logical Editors in conjunction with macros to mimic a true scripting language. But again hit & miss, with miss in the lead.

Tks, guys.

If you are on Windows you could use AutoHotKey to create a simple script that toggles between two commands for each key press. I’m assuming you can do the same with Keyboard Maestro on Mac.

exactly, same for Touch Portal where you can also create “if..then” buttons

@mlib You’ve been using AutoHotKeys for a while now, right? Did they ever cause any sort of trouble or interference with other apps? I am still hesitatant to integrate them although they would surely help to overcome some key command/macro/PLE shortcomings. The option to toggle between frequently used commands is just one example.

@raino A stream deck is indeed tempting, very hard to resist. Personally, I try to keep my outboard gear to an absolute minimum after I decided to abort my spaceship commando central approach a couple of years ago. Still, I catch myself arguing that such a tiny device wouldn’t hurt/count…

Nope. I haven’t experienced any issues with AHK.

Or Bome MIDI Translator Pro for both.

Thanks for the heads up.
I did a few test runs with AHK and got it working nicely after finding out about some Cubase specific requirements.
I would still love to see more options for key commands, PLE, macros in Cubase, though.

@assisfig2 If you want to toggle between two automation commands using AHK here’s the code. Lines preceded by semi colons are just info, you can as well delete them.
Reassign the Cubase key commands for show/hide to any spare keys you will most likely not touch (Alt + F3/F4 were just test keys here, same as Ctrl + Alt + J for the toggle command).


#requires Autohotkey 2.0
; toggling between Show/Hide All Automation assigned to F3 & F4 in Cubase by pressing Ctrl + Alt + J 

;making sure your script has admin rights
if not A_IsAdmin 
{
    Run('*RunAs "' A_ScriptFullPath '"')
    ExitApp()
}

ToggleState := false

; the designated toggle key in Cubase Ctrl (^) + Alt(!) + J
^!j::
{
    global ToggleState
    ; making sure these commands are executed in Cubase  
    If WinActive("ahk_exe Cubase15.exe")
    {
        if (ToggleState = false) 
        {
            SendEvent ("!{F3}")
            Sleep 120
            ToggleState := true
         }
        else
         {
           SendEvent "!{F4}"
	   Sleep 120
	   ToggleState := false
         }
      }
      else    
      {
        ; if Cubase is not running just do with that key whatever it’s supposed to do outside of Cubase
        Send("{^!J}")
       }
 }

Fair warning:
This is my very first go at AHK code so there’s probably a more elegant and quicker way to do it. Anyone familiar with AHK, please, feel free to improve this clumsy code of mine :slight_smile:

If you want to open and close automation on selected tracks with a single command you could try to use the toggle selected track command under track folding. You can assign it to a key command or MIDI Remote device.

Brilliant @GregOndo, that’s a much easier way to do it, thank you! :+1:

Is there a similar hack for show/hide automation on all tracks by any chance?

EDIT: I forgot that this command will always open an automation lane even if there’s no automation on the track. In other words, it’s not toggling between the states show/hide (existing) automation. So I’m back to the initial commands. Your approach is cool, just not what I was looking for…

If you have to go the third party software route, what you will want to look for is something that can handle global variables. So they remember the state of the variable and can call the state, and also change the state every time you press.

I was going to recommend Bome’s MTP as well because it’s good at this. I had to start using it because Corsair’s iCue isn’t great with these things. ICue can do a very basic toggle but nothing that useful.

Although If you learn to write AHK scripts you can do basically any shortcuts.

For the Bome MTP toggle:
I reserve a global variable for this task only. Lets choose “vn”. So when the project starts the variable has to be assigned a value.

Translator: Input: “on project start” = vn=1
So now whenever Bome calls vn the value will be 1.
We can use the value to determine the status of our toggle.

If we want to “show automation” we can have vn=1. “Hide automation” vn=0.
So on our “A” button it will call the value but then after it will also toggle its value between 0 and 1. Then depending on if it’s 1 or 0, it will trigger a hotkey.

In Cubase if “show automation” is custom set to Ctrl + Shift + A, and “hide automation” = Ctrl + Alt + A, then the output from Bome will be “if vn==1 then Ctrl + Shift A”. “if vn==0 then Ctrl + Alt A”.

That way you can have the toggle on the same qwerty keyboard button because it alternates in MTP. MTP tests what the variable currently is, then executes the proper keystrokes and Cubase intercepts the keystrokes. The problem is it doesn’t query the daw to see what the automation’s current state is, so it can get out of sync. There can be another button that will reset the variable but at that point you’re doing just as much manual work as not having this toggle at all.

You will need two outputs for the same “A” key input.

Translator 1:
Input: Keystroke A

Rules:
if vn==1 then exit rules, skip Outgoing Action
vn=vn^1 (this is the toggle. That is the math for toggling between 0 and 1).
(if it skips outgoing action, it doesn’t execute or toggle the variable. The other translator that accepts the same A input will trigger instead)

Output:
Keystroke: Ctrl + Shift + A

Translator 2:
Input: Keystroke A

Rules:
if vn==0 then exit rules, skip Outgoing Action
vn=vn^1
(Either translator 1 or 2 will be triggered because the variable will either be 1 or 0. I found it’s better to have two translators rather than both in the same rules, to avoid bugs).

Output:
Keystroke: Ctrl + Alt + A

Or you could have both rules in the same translator, and the output can trigger one of two “timer” translators. These timer translators will accept the variable and send the respective keystrokes. The first translator is the binary gate that is triggered by pressing the A key, and tests the variable; then chooses which timer to trigger.