Jump to content

Scripting Logic Pro X using Keyboard Maestro


carlcaulkett

Recommended Posts

Hello, over in `Patches, Plug-In & Channel Strip Settings` you may have seen the thread `3rd Party Plugin factory presets database for Logic`. It's been going for 11 years and has grown so big that recent reports have said that it can be observed from space!

 

Many folks have used a variety of means to automate the process of generating Logic presets from plugins so that they can be browsed using Logic's library. Recently, I had some success using an automation tool called Sikuli but it has transpired that the smart kids around here use Keyboard Maestro for their macro needs.

 

This post, therefore, is intended to be the start of a thread which deals, not only with generating presets but with the wider issue of automating Logic Pro X in general but with a special emphasis on using Keyboard Maestro.

Link to comment
Share on other sites

This is in the big thread but.. is important.

 

If you're going to generate Logic AU Presets presets for a commercial library and plan on sharing them, please work directly with the developers - and let them distribute the au instruments with their commercial libraries. These AU Instruments can bypass other restrictions on their libs. I learned this, early on from Urs Heckman. I am thankful I asked :) as he pointed out that the settings from their presets get baked into the au instruments.. negating the need for someone to actually purchase their commercial libraries. Since then, I have been sharing au presets that I generate - but only directly with the developers. I've done this with a few u-he lib developers, and a handful of others. I can probably share the macros I use.. but there is no documentation (short of Des' description of how to approach this). :) Anyway - I'll post up an export of what I have used, which might be a good starter for someone new to this.

 

Joe

Link to comment
Share on other sites

Also... (as long as we're here). There was a recent thread on GearSluz, where a user (@vanhaze) posted up a list of the macros that he has created for Logic Pro. The list is at this location: Some good ideas imo.

 

Yup, I participated in that thread, and I'm demoing Keyboard Maestro right now :) Since you're a KM user, I'm trying to replicate van haze's Trim Region End to Mouse macro but I feel like I'm missing certain pieces... I think it has something to do with the Move or Click Mouse action but then I get stuck. I'd like to know what the Action name is for the moving the region to the mouse. Any help?

Link to comment
Share on other sites

Thanks for starting the thread. I’m primarily using KM (at least in conjunction with Logic - I use it for quite a few other purposes too) for creating Logic presets, so I’ll try to go into a bit more detail about my approach with some more concrete examples and script examples when I get the time to document them.

 

Then I’m sure as the thread develops I’ll try to contribute as I can...

Edited by des99
Link to comment
Share on other sites

I’ll try to go into a bit more detail about my approach with some more concrete examples and script examples when I get the time to document them.

Please do! Until the day we finally see a native Macro feature in Logic, apps like these come in super handy and are a God send :D

Link to comment
Share on other sites

This is in the big thread but.. is important.

If you're going to generate Logic AU Presets presets for a commercial library and plan on sharing them...

 

I'll go further on this and say - do not share commercial libraries, full stop. By all means convert your own purchased commercial libraries for yourself, but you do not have the rights to distribute commercial patches, whatever has been done to them. The preset sharing thread referenced above is for *presets that come with the instrument*, and thus, everyone who owns the instrument already owns those patches - creating Logic format versions as a convenience to owners of that instrument is generally fine.

 

But third party. commercial, paid-for or banks that are not free and publicly downloadable from the author are off-limits - as Joe says, you're simply sharing commercial products and making them freely available for everybody, which is very obviously a no-no.

 

By all means, as Joe says, if you want to work with the developer of those commercial libraries to create Logic versions, great. Then the copyright owner can decide how to distribute them, as is right and proper.

Link to comment
Share on other sites

I'm trying to replicate van haze's Trim Region End to Mouse macro but I feel like I'm missing certain pieces... I think it has something to do with the Move or Click Mouse action but then I get stuck. I'd like to know what the Action name is for the moving the region to the mouse. Any help?

 

I'm not sure what's going on here - I'll try to have a look at that in a moment.

 

But remember, all KM is really doing is remote-controlling Logic - so, it's sending mouse clicks, or keyboard commands to Logic - there's often not much that's particularly "clever", except in the problem solving techniques of the script creator, perhaps, as macro controlling sometimes requires a bit of left-field inspirational creative problem solving...

 

Edit: Ok. So there are usually different ways to achieve a given goal. One way I can think of to do it would be:

 

- You have a region from bar 1 to bar 7

- Your mouse is at around the 5 1 0 0, over the region you want to trim, as you want to trim your region end to bar 5

- You execute the macro, which does:

- Step 1: Send key command to select Logic's Scissor tool

- Step 2: Click where the mouse is to split the region at that bar (this leaves the second region selected)

- Step 3: Send a Backspace key to delete the selected region

- Step 4: Send key command to re-select Logic's default arrow tool

 

Now this isn't necessarily the best way of doing this, and the GS poster doesn't say how he's implemented it, or what the exact behaviour is, so I don't know.

 

Might be a nice exercise for us to see how many other ways this could be done using Logic + KM...

 

Edit: I also came up with a few variations that afterwards I see someone in the GS thread also mentioned, which is using locators, but I think that's a less optimal solution as requires picking up the playhead position by clicking on the timeline vertically up from the mouse position (which I would regard as a bit "fragile"), setting rounded locators of the region and then right locator by playhead, and then trimming the region by the locators, then restoring the original mouse position.

Link to comment
Share on other sites

Oh, I just remembered another use I put KM to in Logic - batch processing Logic's controller assignments.

 

You can't just select a bunch of assignments and change a parameter for all of them - only the first one of the group selected changes. So on occasions I've needed to change a whole bunch of assignments - hundreds or even thousands - and I used KM to make the change, step to the next assignment, make the change, etc in a loop.

 

Comes in handy!

  • Like 1
Link to comment
Share on other sites

Just got String Machines 2 and the preset name does not appear in Logic preset field as you advance with the Plugin preset arrows. It’s in the UVI workstation and I can’t pull the preset name as the GUI does not appear to have its own save function to pull it that way. Any suggestion how to pull preset name to copy and save?
Link to comment
Share on other sites

I don't think there's a direct way to get the patch names from the UVI Instruments, as there is no way to actually save patches or edit names within the plugin.

 

For instruments such as these, I will go to try a Finder method where you can try to pick up the name from the Finder in parallel with patch saving - unfortunately, the UVI instruments all bundle the content (samples + patches) together in one encrypted file, so the individual patches are not files, which rules out that method.

 

So, tricky one. If I were approaching this, I think what I would do would be this:

 

- Take screenshots of each of the subfolder contents you want to save (Bass, Bell, Fretted etc in the example below)

- OCR those into a text file, with each patch on a separate line - they will be in the same order that the plugin displays them

- Use the parallel method of name extraction during the save process (Ie, start at patch one, flip to the text editor, pick up name 1 into the clipboard/variable, go back to Logic, save the patch, paste in the name, increment the patch, loop...)

 

uvi.thumb.jpg.be2d8cfb8540be5da8439a458eb7cc35.jpg

So, once you have the text file of the patch names, you're basically doing:

 

- Activate TextEditor (or whatever your text editor is)

- Select the first line

- Copy name

- Move to the next line ready for the next iteration

- Activate Logic

- Save As

- Paste name

- Increment the patch

Link to comment
Share on other sites

Wow ocr screenshot. I think as s KM newb I am going to manually do this one as it’s a few hundred not thousand.

 

I don't think there's a direct way to get the patch names from the UVI Instruments, as there is no way to actually save patches or edit names within the plugin.

 

For instruments such as these, I will go to try a Finder method where you can try to pick up the name from the Finder in parallel with patch saving - unfortunately, the UVI instruments all bundle the content (samples + patches) together in one encrypted file, so the individual patches are not files, which rules out that method.

 

So, tricky one. If I were approaching this, I think what I would do would be this:

 

- Take screenshots of each of the subfolder contents you want to save (Bass, Bell, Fretted etc in the example below)

- OCR those into a text file, with each patch on a separate line - they will be in the same order that the plugin displays them

- Use the parallel method of name extraction during the save process (Ie, start at patch one, flip to the text editor, pick up name 1 into the clipboard/variable, go back to Logic, save the patch, paste in the name, increment the patch, loop...)

 

uvi.jpg

So, once you have the text file of the patch names, you're basically doing:

 

- Activate TextEditor (or whatever your text editor is)

- Select the first line

- Copy name

- Move to the next line ready for the next iteration

- Activate Logic

- Save As

- Paste name

- Increment the patch

Link to comment
Share on other sites

Just got String Machines 2 and the preset name does not appear in Logic preset field as you advance with the Plugin preset arrows. It’s in the UVI workstation and I can’t pull the preset name as the GUI does not appear to have its own save function to pull it that way. Any suggestion how to pull preset name to copy and save?

 

Aloha Steven -

 

Look at the presets I shared with you. In addition to other soft synths, I used those macros to generate presets for UVI Grand Piano Collection, Cameo, Falcon. Pretty certain I used the method that Des describes to save them. Check out the "Next Falcon and Next Falcon Lower" macros. Those position themselves within the UVI GUI, choosing to move to the next preset. Then - the macro issues a "SAVE AS" command, and from the pop up dialogue executes a Command-A (select all), and Command-C (Copy to buffer) from the area that has the preset name.. That copies the UVI preset name into the copy buffer. Finally - the macro finds and presses the [Cancel] button, closing that dialogue. This macros is embedded in the "2 SAVE a PRESET Many" macro.. which loops through xxx times within the GUI. So - you need to change this one, to call the UVI one (I believe it was set to "Next DIVA Preset" in the macros I sent you. Change that to Next Falcon Preset--- if you want to see it in action)

 

I know it's a little convoluted... which is why sharing stuff like this is difficult. There are a lot of ways of making this all work. It's far easier, when you can stick to just the Logic PRO GUI... but it's definitely possible to screen scrape preset names off the instrument GUIs too. The high level process is:

Loop xxx times --

Click within the GUI to select the next preset

Select SAVE AS from the Menu

Screen scrape the preset name (copy/paste the text) to the buffer

Close the Save AS dialogue

Save the preset

next . . .

Link to comment
Share on other sites

You're doing this in Falcon though, not the UVI Workstation?

 

As I see it, in UVI Workstation, there is no Save As command (unless I'm missing something super obvious) and thus no way to get at the name at all... (hence the OCR recommendation, which should only take a few minutes to screenshot and compile the text file of names.)

Link to comment
Share on other sites

You're doing this in Falcon though, not the UVI Workstation?

 

As I see it, in UVI Workstation, there is no Save As command (unless I'm missing something super obvious) and thus no way to get at the name at all... (hence the OCR recommendation, which should only take a few minutes to screenshot and compile the text file of names.)

 

Oh crap... I sure was! Must... read.... more....carefully - before replying. I thought I had used workstation for one or more plug-ins, and will try to dig up how I did it. Sounds like, I may have had to do manual generation though. Sorry for the diversion guys ...

 

Joe

Link to comment
Share on other sites

Interesting method for the Valhalla plugins.

 

Again, with these, there is no direct way of getting the patch name - when you click "Save", the current preset name does not populate the save dialog.

 

So, instead, the plugin has a "Copy patch to clipboard" feature, which creates a text representation of the patch to the system clipboard - so we do that, then use a regular expression text search step to extract the name from the patch in the clipboard. Works great!

Link to comment
Share on other sites

Interesting method for the Valhalla plugins.

 

Again, with these, there is no direct way of getting the patch name - when you click "Save", the current preset name does not populate the save dialog.

 

So, instead, the plugin has a "Copy patch to clipboard" feature, which creates a text representation of the patch to the system clipboard - so we do that, then use a regular expression text search step to extract the name from the patch in the clipboard. Works great!

 

Now if they had a "Copy all patches to aupreset" feature we could close down this thread.

Link to comment
Share on other sites

  • 3 weeks later...

Hi 2 all,

 

Just wanted to make a global statement regarding the use of Keyboard Maestro in conjunction with Logic Pro X;

If you are always looking to speed up workflows in Logic Pro X, (like me), Keyboard Maestro may be your best friend.

The lack of making macro actions in Logic always annoyed me but using Keyboard Maestro you can make macro actions that work in Logic, speeding up

things that you want to accomplish in Logic greatly.

 

I am in no way connected to Keyboard Maestro so don't see this as a commercial talk, but i honestly think KM is worth every penny.

But in the end, native support for macro actions would be the bomb ofcourse.

 

Look at Reaper or Cubase or Waveform 9, these DAW's greatly support marco actions.

Reaper even takes it a step further, supporting scripting languages like lua, python and eel.

There are hundreds of free scripts availabe for Reaper, made on a (mostly) free basis by scripting people.

The stuff that you can do with those scripts is insane, not possible in any other DAW (that doesnt support macro actions and/or scripting).

 

Please Apple , introduce macro actions in Logic please !

#MoreCreativityInLessTime.

Link to comment
Share on other sites

  • 3 weeks later...

I'm slowly getting used to the Keyboard Maestro way of doing things. My first effort is a macro designed to be used with the Auganizer application. The idea is that I can easily step through the list of Plugin names, and view the "Show plug-in info" data for each item. It's just ⌥⌘↓ to activate the macro, ↓ to dismiss the popup, and ↓ again to move down to the next entry.

 

Here's the macro...

as an image...

1752996927_ShowInfo.thumb.png.c9c439cac9a722d29fa1f78f2669b94c.png

 

and as a file (you'll need to unzip it)...

Show Info.kmmacros.zip

 

I've used the "Find Image" action to fix the mouse position to a listbox so that I can do a right-click action over the selected item. This apparently is something that is not supported directly because of limitations in macOS. I'll be using his technique in future macros, but hopefully, this may be worth looking at.

Edited by carlcaulkett
Link to comment
Share on other sites

  • 1 year later...
Insert Note at Mouse

Three steps in KM:

 

- Type a Keystroke (let it type the key command for Set Pencil Tool)

- Move And Click Mouse @ 0,0 from current mouse location

- Type a Keystroke (let it type the key command for Set Previous Tool)

 

Now hover over the desired spot in the Piano Roll and hit your new-fangled Ü or whatever triggers the KM macro and voila, just like magic - a note is there. Might not seem much when you just could have clicked, but may speed things up considerably when you're populating Regions like this all day.

Link to comment
Share on other sites

Insert Note at Mouse

Three steps in KM:

 

- Type a Keystroke (let it type the key command for Set Pencil Tool)

- Move And Click Mouse @ 0,0 from current mouse location

- Type a Keystroke (let it type the key command for Set Previous Tool)

 

Now hover over the desired spot in the Piano Roll and hit your new-fangled Ü or whatever triggers the KM macro and voila, just like magic - a note is there. Might not seem much when you just could have clicked, but may speed things up considerably when you're populating Regions like this all day.

 

Thanks! And to me, it does feel like quite a lot, and a really useful thing to have, and a good start to getting Logic Pro X to do what I want it to do, rather than me trying to modify myself into doing what it wants me to do. Can't wait to use Keyboard Meastro more with Logic Pro X.

 

What do you think the steps would be to also be able to use the same shortcut to delete a note? i.e. Same shortcut for creating and deleting a note?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...