How do I sequentially name Logic Pro bounces with piano keyboard labels?

I have audio samples (regions) that I have recorded in Logic Pro that I need to bounce out (save) and rename incrementally, but also with piano keyboard labels.

The names for each bounce need to go incrementally in order for each bounce:

… up to Organ 68_C6

The list of piano keys is:
"C0", "C#0", "D0", "D#0", "E0", "F0", "F#0", "G0", "G#0", "A0", "A#0", "B0",
"C1", "C#1", "D1", "D#1", "E1", "F1", "F#1", "G1", "G#1", "A1", "A#1", "B1",
"C2", "C#2", "D2", "D#2", "E2", "F2", "F#2", "G2", "G#2", "A2", "A#2", "B2",
"C3", "C#3", "D3", "D#3", "E3", "F3", "F#3", "G3", "G#3", "A3", "A#3", "B3",
"C4", "C#4", "D4", "D#4", "E4", "F4", "F#4", "G4", "G#4", "A4", "A#4", "B4",
"C5", "C#5", "D5", "D#5", "E5", "F5", "F#5", "G5", "G#5", "A5", "A#5", "B5",

I have setup Keystrokes in a Macro to just move to the next region and Command + B to bounce with this:
Keystroke: Right Arrow (select next region)
Keystroke: Command + B (bounce audio file [from all tracks])
Keystroke: Return (selects ok in bounce window)

I just need some help with the Save File As window to:
Paste: Organ_
Paste: Incremental number from 01 to 68
Keystroke: “_”
Paste: Next piano key value

Any help would be greatly appreciated.

First, set up the variables. You need a variable with the list of Keys, with just the key names separated by commas. You could remove the quotes and line breaks and spaces with a text editor, or I just used an action to do it. Set the variable array Keys and the index variable Index (ensure you use 01 for its first value).

Keyboard Maestro Actions.kmactions (1.5 KB)

Note: These are exported actions, you can drag the file into an existing macro or use the Import Actions menu to import them into an existing macro.

Then you can set the name as the index and the Keys entry, and then increment the Index, formatting it with 00 to keep the two digits.

Keyboard Maestro Actions.kmactions (765 B)

Then use the variable Name (%Variable%Name%) in your text when you are in the Save As window. Make sure you include appropriate Pauses to ensure controlling the Save As window works reliably.

Two questions:

  1. Are you applying any channel processing or are you trying to bounce raw samples as audio?

  2. Are all regions on a single track or on their own individual tracks?

  1. Yes, there is channel processing. I have an ambisonic decoder for the four of the tracks that are the individual WXYZ ambisonic channels.

  2. I have a multi-track session where organ notes were sampled with a few different mics with levels set and ambisonic decoding. So, the bounce mixes the multitrack for each individual sample, but needs to be labeled on bounce. It's similar to a multi-track drum session with individual hits, but for pipe organ.

I had an idea that you might like to play around with. Here's my thinking:

  • Bounce your entire group of multitracked regions as a single file.
  • Import that file back into the same session and align it.
  • Chop it up (programmatically, of course) at exactly the same points as the source regions.
  • Export your newly chopped regions as raw audio files to a folder.
  • Rename the files according to your aforementioned naming scheme.

Here's a video of the chopping procedure. The sample regions are orange and the reimported bounced file is blue.



Here's a gif of the renaming macro in action:

Demo Video

CleanShot 2023-09-06 at 23.20.06

...and yes, the script I'm using accounts for the fact that the first exported file is simply called Sample.wav without an appended number.

Here are the macros I've put together:

Chop Bounce at Regions.kmmacros (38 KB)

Macro screenshot

Anything you should pay attention to is coloured green:

  • Choose a name for the sample folder. It's imaginatively pre-filled with "Samples".
  • The other green actions are all the same. The Logic key command Select All Regions of Selected Track. Either change your key command in Logic to match mine, or change the simulated hotkey actions to match your existing key command.
  • If audio processing during your multitrack bounce results in any latency, it may be necessary to manually align the bounced file to your source regions. I believe this to be a minor chore, more than justified by the time saved by the macro.
  • This macro makes use of markers to set the split points by region start. So as not to end up with output files longer than intended, it is advisable to concatenate your source regions before bouncing the file to be chopped.
  • As markers are essential to this macro, ensure there are no existing markers in your project before the macro is executed.
  • You'll notice that the two Logic dialog windows that appear may take a moment to respond. That's normal.
  • During the chopping part of the macro, a menu item will flash up repeatedly. This is because it is sometimes necessary to double-trigger Logic's menu items. Logic doesn't update its menu item availability until a menu is opened, so we have to programatically open it, close it and open it again. Just one of those things.


  • Select the track above the bounce and trigger the macro.

Rename Samples with Note Names.kmmacros (21 KB)

Macro screenshot

  • Green action: Choose a prefix for the renamed files. In your example, you used "Organ", so I've stuck that in.


Open the sample export folder and trigger the macro.

1 Like

Oh... Man! Thanks for the detailed response! You're awesome for doing this!

Your suggestion to bounce first, reimport, split, rename and export may just be the best approach! This would also allow me to combine other microphone pairings and automate the process.

I'll give it a try and let you know how it works out.