Triggering Stream Deck Profiles for Logic Pro Plugins

Hi. Yeah unfortunately that doesn't work in Logic.

I have a suspicion that this is helping matters in the case of S1:

I'm not sure how Dio managed to get nAc to recognise the plugin windows in Logic, so I've emailed to ask! :+1:t3:

I asked him a similar question about Studio One and he then pointed me into the direction of the Accessibility Inspector. So in the case of Logic there is no reference to the plugin name anywhere in the Accessibility Inspector? That makes it all the more surprising that he was able to pull that info from somewhere...

People like him and yourself make this journey much more pleasurable, sharing all this knowledge so readily :grinning:

UI Browser does the same thing, and nothing shows up there, unfortunately. I'll report back if Dio has any golden nuggets of wisdom to share. He's probably reading this, as I sent him a link, so... Hi Dio! :wave:t3:

@noisneil Things are coming together nicely. Profile switching via the blank apps works well. Are they just empty applescripts compiled as apps? Or is there any code in them?

I spent quite a bit of time trying to deal with the fact that running blank trigger app moves the focus away from the DAW for brief moment, which results in a brief disappearing of the plugin window, because in Studio One that only shows when the DAW is the front application.

I tried various scripting approaches in an attempt to run the blank trigger apps in the background. At first I thought my scripts were wrong, but I have now come to the conclusion that Stream Deck requires an app to be 'actively active' (in other words, it has to be the front application even though there isn't a window) and that therefor it is simply not possible to avoid this temporary glitch in the focus. Do you agree? Or can you think of a workaround? Thanks

Yep.

Interested to know how you got around that. The fact that the blank apps momentarily take focus away from the current application is the thing that causes the most annoyance with this method. This is why there's a Semaphone Lock in my macro. If it wasn't there, switching back from the blank app to Logic would trigger an endless loop of profile switches.

Correct. I wouldn't sweat it though if the only downside is that the plugin window blips for a split second. If it's causing profile loops though, try adjusting the Semaphore Lock's pause (at the end of the macro).

If only Elgato would allow us to switch profiles from the command line or via Midi (or any means!), we wouldn't need to do all this stuff!

Thanks. yes, some form of an API from Elgato would make the whole operation a lot easier

I was getting individual components of my solution to work and all seemed hunky dory but now that I am sticking it all together I am running into some looping as you predicted. Semaphore does come in handy but I also need to introduce a variable or two. Nothing unsolvable though. I'll share my approach when I'm done (or stuck :wink: )

@noisneil Hi Neil,

I have been busy with family matters so had to juggle my time a bit, but I got it working, finally.... First I actually have to use the solution for a bit to see if there are any teething problems, but it looks promising.

One observation that may be of interest to you (but maybe old hat): When I used %WindowName%1% to see if a plugin was up on the screen I got very mixed results. Oddly only Pro-Q was detected that way, other plugins weren't. Then I stumbled upon %WindowName%Front% and that always included the plugin name.

Maybe this is only of relevance to Studio One, but then again, maybe it is also useful for Logic.

I'll report back once I'm sure that my approach works and I'll then share my macro if you are interested.

Thanks for your help.

Great that you got it working! Hope it stays stable for you.

Unfortunately (for me) the window titles thing is a dead end for Logic plugins, but good that you flagged it for any other non-Logic users interested in this. :+1:t3:

Hey Neil,

Thank you so much for posting all of this useful stuff! I've used a bunch of your macros and it really helped me to get an understanding of the whole system. I'm looking to implement the setup above in a really simple way - when I double click a MIDI region, or hit "P" on my keyboard to open the piano roll (this is now so embedded in my muscle memory that reaching for a button on my streamdeck just wont happen) I'd like the StreamDeck to switch to my PianoRoll Profile.

With all the iterations of this macro I'm a little confused about getting this working. Any chance you could do a knucklehead-level walk through for me?

Thank you again!

Hey no worries! Glad to hear they were in some way useful!

Unfortunately, if there's a way to use the Piano Roll appearing as a trigger, I'm not aware of it. What can you imagine might be a way to trigger the profile change that you'd be happy with? I'll see if I can think of a workaround from there.

yeah, I figured it's not like a window coming to focus but rather part of the main window.

It would be ideal that if I double clicked a MIDI region my streamdeck changed to piano roll scene, or if I hit P on my keyboard.

Any work arounds would be great!

The double click thing isn't going to be viable. I wouldn't recommend using a single letter like P as a trigger either, due to conflict when naming tracks etc. Not sure how to help without you having to abandon your muscle memory I'm afraid.

I've modified the above to work with the BetterTouchTool StreamDeck integration, so it doesn't use trigger apps.

Instead it uses AppleScript to tell BetterTouchTool to change the StreamDeck group. When you quit, it uses AppleScript to tell it to quit the group.

To use the below, you just need a BetterTouchTool group with the same name as the plugin.

tell application "Keyboard Maestro Engine"
	set bttAction to getvariable "PluginName"
	set bttJSON to "{\"BTTPredefinedActionType\" : 341, \"BTTOpenGroupWithName\" :\"" & bttAction & "\"}"
end tell

tell application "BetterTouchTool"
	trigger_action bttJSON
end tell

@ajgorkin I've also been trying to do the same. I settled for a screenset where the piano roll is full screen. The change in window name from 'Tracks' to 'Piano Roll' triggers the profile change.

I wasn't quite sure what the new BTT SD features were, but it sounds like it's possible to programatically trigger SD profiles...? Does it feel any differently to a native profile change? The main problem with the blank apps is the focus switching. Presumably, this is an improvement!

I wish I didn't have to install another piece of software just for this, but hey-ho!

Well BTT is completely taking over the Stream Deck, so if you have nice profiles set up already (which I didn't) it may not be worth starting over. It also has doesn't have 'profiles', instead you set which buttons show up based on different conditions (like, window name, app name), and they can even overlap with each other. I have lots of good things to say about it, and for me, it meant I could get rid of the Stream Deck app.

But yes the group change occurs without changing focus. It's essentially opening a folder and it's pretty neat.

Question: I'm testing the macro with several plugins and some work perfectly, and some are making it act strangely. Sometimes when the window opens, the OCR scan isn't performed. If I click to another window and back to it, it triggers. I've turned on highlighting so I can check this. For example, MicroShift and Melodyne seem to be acting more strangely than others.

Are you using the Compare button as a condition to run the OCR?

Yes. I just added a delay before the 'If' step runs and it seems to be working more consistently

Hey @noisneil
Finally understood how the KM macros work and started using this macro.
Could you share the SD profiles that you're using with the macros?
Still working on adapt on my environment
Thanks!

My SD profiles won't mean anything to you unless you also own a nObcontrol.

1 Like

Dear Sir,

Thanks for sharing your setup.

I have setup everything as you described.

The profile in SD is switching as expected as soon as I open the Channel EQ, however, the issue is that the trigger to change the SD profile is sent constantly by the refresh rate of the value of the pause of the semaphore lock.

In this case, I guess that the trigger "the focused window title changes" is sent all the time.

If the Channel EQ is open, you can see the KM icon spinning all the time. If I open another plugin, that is not in the Plugin Whitelist, the icon is not spinning.

I have spend quite some time to solve this, but I am a bit lost here.

Can you tell me what is going wrong?

Kind regards,
Steven