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 the blank app below 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.

For each of these macros, pay attention to the green and yellow actions when setting up.

—————————————————————————————————————————

Logic SD Profile Switcher.kmmacros (339.4 KB)
:point_up:t3:The main macro group.
Force Quit Trigger Apps.kmmacros (24.0 KB)
:point_up:t3:One macro in its own group.
Profile Switch - Clean Variables.kmmacros (28.2 KB)
:point_up:t3:Put this in your Global Macro Group.

—————————————————————————————————————————

NOTES:

Macros 1-7, contained within the main macro group:

Macro 1

The first 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 Stream Deck profile. This, believe it or not, is the simplest version of recalling profiles and I no longer use it, now that the process is entirely automated. However, if for some reason the full automation doesn't suit your way of working, 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 that 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

—————————————————————————————————————————

Macro 2

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. 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 OCR result is not entered into the Whitelist during setup, it will not trigger an automatic profile switch.

—————————————————————————————————————————

Macro 3

This is the OCR submacro, which needs to be selected in Macro 2.

—————————————————————————————————————————

Macros 4 & 5

These sub-macros prevent feedback loops that would repeatedly trigger macros 2 and 3 over and over because of window focus changes. You will select these when setting up Macros 2 and 3 respectively, in the actions marked out in yellow.

—————————————————————————————————————————

Macros 6 & 7

Macros 6 & 7 are Whitelist submacros. For each plugin you would like to trigger a specific or generic profile, copy its OCR scan result, one-per-line. I have pre-filled the Window whitelist, which prevents the macros triggering if a plugin is not open, according to my own requirements. Add to this if need be.

—————————————————————————————————————————

Force Quit Trigger Apps

This ensures that trigger apps quit properly after having run. Put this in a global macro group and 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.

—————————————————————————————————————————

Profile Switch - Clean Variables

As a quirk of how I've got Macro 2 to work, this group is necessary to keep your Logic profile from becoming inactive when you switch to another app and then back to Logic.

—————————————————————————————————————————

"So, why can't I just use the plugin name when naming the trigger apps or adding lines to the Plugin Whitelist?"

You may notice that some plugins return garbled OCR results. No idea why, but in my experience, it will be the same garbled result every time and therefore still acts as a good 'fingerprint' for the plugin. Therefore, you need to make sure the macro is looking for the OCR result, which may not necessarily be identical to the plugin's proper name. As an example, on my system the plugin SketchCassette II comes back OCR'd as "Biola Orso". :man_shrugging:t2:

Tip: to find the plugin's OCR result, have the KM preferences window visible while allowing the OCR to run on a plugin in Logic. You will see the OCR result appear under the PluginName variable.

5 Likes

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

2 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