AutoHotKey Batch Export?

I’d like to automate the export of stems. My manual workflow is very simple:

  1. Mute all buses (e.g., Drums, Bass, Pianos, Strings) **
  2. Unmute the desired stem bus (e.g., Drums)
  3. Export
  4. Re-mute the stem bus (e.g., Drums)
  5. Repeat for remaining stem buses

** Note that soloing stem buses doesn’t work because upstream effects channels don’t always get printed.

It’s a simple process but tedious, at roughly ten-minutes per stem. Factor the mix master and a couple alt mix versions (e.g., Clean, VocalUp, VocalDn), and you’re facing three hours of thumb-twiddling. If you carry this over to pre-mastering, you’ll repeat this at least three times per audio file (though the processing demands and time are usually a bit less). It’s days of work that could instead be done while I sleep.

I’ve tried automating this procedure with AutoHotKey, but am having difficulty. For example, I can target the Project window and send keystrokes to cycle through the tracks and disable/enable the mute button. But when it comes to interacting with the mixdown window, things fall apart. For starters, I can’t target the filename field because Window Spy doesn’t reveal any identifying info for it.

Any AutoHotKey experts have some pointers?

Thank you.

You will probably have to tab to the fields, or do mouse clicks.
eg:
Do WinMove to place and size the export window, and use mouse clicks.

Are you saying that If you didn’t have to name the files it would work okay?

Thank you for the hints! I’ll give this a shot.

So far, I’ve had success stepping through the buses, muting and unmuting, accordingly, but haven’t gotten to the point of creating an automated loop with logic-driven stop point (e.g., "if channel name = ‘Master,’ stop execution). And, ideally, filenames will be logic-drive too, per the bus name, but static auto-incrementing names (e.g., Export1.wav, Export2.wav) would be fine too.

That process can be tricky, I manage to make it from workflow/Template perspective
AHK could be beneficial but is tedious to make it like u imagine.

These are my workflows for exporting STEMS:

  1. Exporting 8 Stems groups (Mastering Mode)
    (1. Kick&Bass, 2. TopDrums, 3.Pads-Strings 4. Main elements, 5. Background elements, 6.FX, 7.Vocal…)
    While working on project I make myself to group each element to one of the 8th groups so in the end when you mute all 8 Stem groups all channels in project gets muted.
    In multiple export just select those 8 stem groups and you are ready to go :slight_smile:
    —Cons: You have only 8 Stems and often get multiple elements in one stem
    —Pros: Easy to setup and when they are summed its = premaster, good for further mastering.

  2. Exporting All elements individually (Mixing mode)
    This is a bit complicated but very effective in my workflow when I have to send all stems separate to clients and yet summed to be equal as premaster.
    — I have shortcut to put “NO_” prefix in channel name via PLE. So when I don’t want some channel to be exported I put “NO_” prefix
    — In order to get 100% summed stems = premaster, I get used in my workflow to put all reverbs/delays on single channel not using aux(send) -anyway this is not big deal since its mixing engineer’s job to apply those effects anyway
    — I have macro to select all channels that are assigned to “Stereo Out” based on this: Is there any way to select only the tracks/channels that are assigned to groups?
    so the main thing above is how to exclude channels that are going to groups in order not to get some channel in 2 or more stems (as solo and as in group)
    with that macro I am able to select all those channels that are going to groups and put the prefix NO_ that way I am avoiding to get duplicated elements in 2 stems.
    — Export macro - which basically (after selecting File/Export Mixdown/Multiple) is to Select all channels except with NO_ prefix in PLE, Audio Export - Sync channel selection with MixConsole.
    It looks a bit complicated but it works in seconds and its reliable.
    —Cons: Complicated and you have to adjust workflow for that
    —Pros: You can get all elements separate and = to premaster (or near equal)

Both workflows are good and are pretty much automated in my case and can export all in one go.

Hope some of this you will find useful :slight_smile:

Thank you for the suggestions!

Likewise, my projects employ a template with groups for common mastering stems (e.g., Drums, Bass, Pianos, Guitars, Synths, Strings) and a few less-common stems too (e.g., Perc, Horns, SFX). Though some go unused in each project, I prefer to have this setup correctly from the start.

When you say “multiple export,” I assume you mean Cubase’s Batch Export? Unfortunately, stems created with Batch Export are dry - fine for mixing, but not for mastering. And, for mastering, once I have all of my mix masters, stems and alternate mixes exported, there’s various operations I want to perform on all of those files (e.g., loudness optimization/bus compression, top-and-tail, dither). This means importing all of those files to a fresh Cubase project and pumping them through a master bus with the desired effects, volume fades, etc. Here, again, Cubase can only export the individual channels, pre-Master bus. So, I have to individually unmute and export each channel through the Master bus.

Supposedly, these batch operations can all be done in WaveLab, but unfortunately, my projects also incorporate 5.1 surround, which WL has trouble with. I’ve submitted bug reports, but there’s no telling if or when they’ll be resolved.

Maybe I’m missing something?

In export dialogue you have single/multi export in channel selection section. I am referring on multiple channel selection. As I am aware there is not “batch export” tittle anywhere in cubase.
Did you tried new export options in cubase 11? There is special options for that. I am not jumped on 11 since some bugs introduced along the way so i cannot point you on those but think there is promotional video on that one.

So, I’ve got some good news and some, well, good news. :grin:

First, I succeeded in developing an AutoHotKey script that prompts for a track count and steps through a series of channels, exporting them, one by one. And it manages all the exports in the background, so you can multitask with other applications on your computer. Here’s a copy, in case anybody wants to reference it or develop it further: cubase_pro_11_batch_export.zip (2.7 KB)

Second, and more importantly, I’ve since discovered that Cubase 11 Pro can, in fact, perform this same operation natively, and with much greater flexibility.

To batch export a selection of Channel Groups (or Audio Channels, etc.) through your master bus, follow these steps:

  1. IMPORTANT: Enable Solo Defeat on your Effects Channels and Groups (or your exports will be dry because Cubase solos the target tracks during export, effectively muting your Effects Channels)
  2. Choose File > Export > Audio Mixdown…
  3. In the Channel Selection window, choose “Multiple” and select the desired channels to export
  4. Choose your desired File Location and File Format settings
  5. IMPORTANT: In the Effects drop-down, choose “+ Master/Groups/Sends (CSPM)” (or your exports won’t be routed through your master bus)
  6. Export (or Add to Queue and Start Queue Export)

Your exports will be uniformly processed - routed through the master bus, complete with insert effects, volume automation, etc. - ideal for producing stems, etc. and processing stems and alt mixes en masse, as you might in a mastering session.

I hope this is helpful.