Triggering Stream Deck profiles for Logic Pro plugins

Firstly, here's a video of what I'm blathering on about:

Intro

If you like the idea of controlling Logic plugin parameters with a Stream Deck, this may be of interest to you.

I can think of many uses for this, the most obvious being plugin UI button-pushes (without having to look at the screen). My personal use-case is rather specific: I have pretty bad wrist issues and use a nObcontrol to reduce time spent on the mouse. In combination with generic and plugin-specific Stream Deck profiles, I can now tweak EQs, compressors and anything else I can think of, without having to look at the screen, with just a few buttons and a big nOb. Ahem...

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

Blank Trigger Apps

This technique relies on a method of triggering Stream Deck profiles by opening blank trigger apps. Make a "Stream Deck Triggers" folder somewhere on your drive and copy this blank app there.

Blank App.zip (51.2 KB)

Duplicate and rename it any time you want to add a profile trigger.

You will want to set up the following blank apps and associate them with their respective Stream Deck profiles in order to get started:

  • One that triggers your Logic Pro profile. This is only necessary for Macro 2. If using Macro 1, you will simply press the back button to return to your main Logic profile.
  • One that triggers a generic plugin control profile (see below for more details).
  • Any number of blank apps that trigger plugin-specific profiles. You have to name these according to the plugin's OCR scan result, which will usually be the same as its proper name... but not always. More on this later.

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

The Macros:

SD Plugin Profile Switcher.kmmacros (273.2 KB)

Group 1:

image

Group 2:

image

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

NOTES:

GROUP 1 - PROFILES

1. Setup

Plugin Whitelist:

I've tried to make this as easy for you to set up as possible. I've added some example plugin names to the Plugin Whitelist which you will need to replace with your own. For each plugin you'd like to add, add its name as shown at the bottom of the Logic plugin window, on a new line.

Trigger App Paths:

Delete the example paths and add your own according to the action titles. These paths will be referenced within the main Profile Switcher macros.

2. Profile Switcher (Button)

This macro can be triggered by a dedicated Stream Deck button (or hotkey), and performs an OCR scan of the selected plugin window, then opens the corresponding blank trigger app, which in turn triggers a Steam Deck profile. I no longer use this, as I prefer the fully automated version (see below). If for some reason the automated one doesn't suit your workflow, this gives you the same basic functionality.

When I was using it, I set up a folder on my Stream Deck called Generic Controls. As you can see, it includes a button called Plugin Profile which activates this macro. So, any time the generic controls aren't enough for a particular plugin, you can press the button and it will switch the Stream Deck profile to one you've set up specifically for that plugin. I use the excellent KMLink plugin to trigger Keyboard Maestro macros using Stream Deck buttons.

This is my Generic Controls Stream Deck folder:

a4df93cb537fbcbfbce8241a7351d71c6d67cbbd

Here's one of my plugin-specific Stream Deck profiles. I've chosen Waves Scheps Omni Channel as an example:

0866dc226bb19e208528d136d3b4cb8af8a7c97c

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

3. Profile Switcher (Auto)

This is the main version and the one I'm currently using myself. It performs the OCR scan and automatically switches Stream Deck profile. If you select a plugin that has a dedicated profile, it will switch to that. If you select one that doesn't (but is on the Whitelist), it will load your Generic profile (see above). If you click away from the plugin UI and back to Logic, it will load your Logic profile. If you click on a plugin that isn't on the Whitelist, nothing will happen.

NB: If a plugin's name is not entered into the Plugin Whitelist in the Setup macro, it will not trigger an automatic profile switch.

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

GROUP 2 - Clean Up

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

Force Quit Trigger Apps

This ensures that trigger apps quit properly after having run. Pay attention to the green actions, where you will select the trigger apps to be quit. Thus far, I've found that the only ones I've had to specify to be quit are the Logic and Generic profiles.

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

App Switch Variable Cleaning

This macro is necessary in ordinary to keep your Logic profile from becoming inactive when you switch to another app and then back to Logic.

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

8 Likes

That's a better video than Elgato's promo videos for their own product.

4 Likes

Hello,

That's really a great stuff!

However for several hours I'm trying to set up a thing out of these macros, and I couldn't get around it. The thing is kind of simple - I just want to trigger a specific Stream Deck profile while changing the Logic's focused window from "- Tracks" to "- Piano Roll" and vice versa. And that's about it. Do you know how to make this work? Any help will be much appreciated!

There's no native way to do this from Keyboard Maestro that I am aware of.

As of right now, the Stream Deck profiles are triggered by application switching only, not window switching.

One way I accomplish switching back and forth quickly between two related profiles is putting a profile switcher button in the same spot on both profiles. So for "Profile 1", I would have a switcher set to go to "Profile 2" in row 1, column 1, and in "Profile 2" I would have the same thing in the same spot but to go to "Profile 1". Obviously it doesn't do anything automatically, but muscle memory is pretty fast and efficient too :wink:

EDIT: I read somewhere about somebody who compiled an AppleScript that did nothing, saved it as an application package, and used that "blank app" as the trigger for SD profiles. I suppose if you wanted to go that far you could aways make a "blank app" for each Logic window, and setup a Keyboard Maestro macro to activate the appropriate app using an IF action triggered when the focused window changes. Seems like a lot of work for little return...but then again I spend hours tinkering around with AppleScripts for silly things like setting DND :laughing:

Yes, that's exactly how my plugin profile switching works, as detailed above. All you'd have to do is set the trigger as a front window change and if the front window contains "- Tracks" or "- Piano Roll" it would launch different blank trigger apps via a Switch/Case action. You can download the blank app I included above for use with this. Duplicate it and rename one to "Piano Roll" and the other to "Tracks". Associate the corresponding SD profiles with these apps in the SD software.

The only thing to be aware of is that opening the trigger app changes window focus again, which can cause a feedback loop, so I included a "Break Loop" macro to deal with that. It sets the variable SDProfile to "DoNotRun" and then deletes it after an interval long enough for the profile switch macro to complete. In the meantime, it precludes the macro from running more than once. It's the most elegant solution I could come up with. I've set the interval to 0.5s, but you may want to monkey around with this, depending on how snappy your system is.

- Logic - Tracks:Piano Roll SD Switch Macros.kmmacros (90.3 KB)

1 Like

Man I didn't at all realize that it was this exact thread where I read that. When I go into the "Latest" section of the forum and click a link it just drops me down to the new comments since the last time I visited and I don't always look through the previous comments before responding :laughing:

Thanks for the reminder!

1 Like

Hi! I'm new to KM and Stream Deck som I'm sorry if I sounds like a newbie. What do I do with this blank app? I can't open it and i can't load it in either Stream Deck or KM.

Download it and make copies of it for each SD profile you'd like to trigger. In this example, I've duplicated the blank app and renamed it Channel EQ. Whenever I open this app via KM, it loads the associated SD profile.
Preferences

Ah, I get it! Thank you.

I'm getting closer but the stream deck software doesn't seem to recognize the blank apps. When I launch the app it won't switch the profile. It says it's "Blank App" even after I've renamed it.

Any ideas what I might do wrong?

Edit: Looks like this is a problem with the Stream Deck software and not the blank apps. No applications make the profiles switch. Running MacOS Monterey 12.0.1 and SD 5.2.0.

Edit 2: "Actually, the feature is working as intended.

To be able to edit the canvas, Smart profiles are disabled when the main application window is open."

Edit 3: It now works as intended with duplicated Blank Apps. I'll leave this post up if anyone has the same problem as I.

1 Like

Okay, I'm nearly there but I have one last issue. I can't seem to make a correct OCR result. Can it be because you have a different screen resolution than you?

When I load a plugin this is what I get. When it's not loaded it says "BLANK".

I vaguely remember running into that issue but it's a long time ago now and I'm afraid I can't for the life of me remember what the solution was. Perhaps someone with more OCR knowledge can chime in? Perhaps one of these threads has the answer? One post suggests that it might just mean the OCR failed, so you should probably try the brand new OCR area function that was added in KM 10...?

Thank you, I'll check it out.

I hate to hijack this thread, but since I've seen a fair amount of interest in this the last couple of years, I reached out to Elgato to ask them about implementing it in the future, and they replied today.

You can read more info here:
Elgato's Response to Setting Stream Deck Profiles via Keyboard Maestro or Other Third Party Apps

1 Like

Solved: Keyboard Maestro Engine did not have screen recording permission. When enabling this in System Preferences -> Security and Privacy -> Screen recording, it is now working.

1 Like

I'm sorry to trouble you with all my questions but I'm so close to making this work. The Logic profile works, the generic profile works and the custom plugin profiles work. The only think that's not working is "Break OCR loop" and "Break profile loop".

I'm pretty sure I've followed all your steps but KM still continues do an OCR scan every time it launches a trigger app and goes back to logic.

Any ideas?

Hmm. Hard to say without seeing your setup, but I would first experiment with the pauses in the Break Loop macros.

Did you change or replace any of the actions? For example, the Break Profile Loop (SUB!) action needs to be asynchronous, so if you added your own Execute a Macro action, without setting it to asynchronous, it might not work.

I'm not really an expert on debugging and I find it can get quite confusing, but if you're accustomed to it, perhaps try running the macros step by step and seeing if the Break Loop macros are kicking in at the right time?

There are a lot of moving parts, so I'm kinda stabbing in the dark here. If only Elgato would just enable external profile switching this would be a lot less complicated!

I've simplified and improved the macros and updated my original post. It now determines whether the window is a plugin by detecting the "Compare" button (rather than using a Window Whitelist). This is quicker and seems to more reliably avoid profile switch loops. I've also included a 'Setup' macro, which makes it easier for you to get going.

Update: Removed the need for the Break Loop submacro by using a Semaphore Lock instead. I have the pause at the end of my Switcher macro set to 0.3s and it works nicely. The macros I've uploaded have it set to 0.5s for safety but feel free to experiment.

1 Like

Can you please make a Video on how to set up the stream deck for the plugins and how to install this/ get this working? I bought a streamdeck and keyboard maestro after seeing your video on the streamdeck+nob workflow. I am new to the stream deck and keyboard maestro so I am lost on how to get this working. Thanks of the workflow enhancement

1 Like