Any assistance is appreciated.
Code: Select all
; This AutoHotKey script renders a series of stems (e.g., Master Mix, Instrumental Mix,
; TV Mix, Keys, Guitars, Bass) imported into a Cubase Pro 11 project, whereby all of
; the source stems are arranged in a contiguous series of Audio Tracks and all of the
; stems are routed to a downstream "master" Group/bus that contains the insert effects
; (e.g., equalization, compression) and automation (e.g., volume fades) to be applied
; to each stem. For mastering engineers, this eliminates the tedious chore of rendering
; a project's stems manually, one by one.
;
; To use this script, the Export Audio Mixdown window must be open (but not necessarily
; visible) with all desired parameters specified. The following parameter values are
; important:
;
; - Channel Selection: (e.g., Surround Out or Stereo Out)
; - Name: (e.g., Auto_Cubase_Export)
; - Path: (e.g., C:\Temp\Cubase\Batch)
; - Conflicts: Create Unique Filename
; - Keep Dialog Open: Yes
;
; The following preparations are also required:
;
; - In the Project Window, mute all Audio Tracks
; - In the Project Window, select the first track to be processed
;
; Multitasking is (mostly) safe. You will receive a standard Windows alert tone 3
; seconds before AutoHotKey must briefly commandeer your mouse and keyboard. Then, it
; will return you to your application. Rendered files are stored in your chosen
; location with auto-incrementing numbers appended to each successive file.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
+^!e:: ; Shift + Ctrl + Alt + e
; Retrieve the location and ID of the "Export Audio Mixdown" window so we can reactivate it
; and press the "Export Audio" button when needed. This will also reactivate the Project
; window, so we can automatically mute/unmute and select tracks for exporting.
WinGetActiveTitle, Win_Active_Title ; Retrieve the user's currently active window so we can restore it
Gui, Font, s10, Verdana ; Set pop-up window's typeface and size
Gui, Add, Text, w500, % "This AutoHotKey script renders a series of stems (e.g., Master Mix, Instrumental Mix, TV Mix, Keys, Guitars, Bass) imported into a Cubase Pro 11 project, whereby all of the source stems are arranged in a contiguous series of Audio Tracks and all of the stems are routed to a downstream ""master"" Group/bus that contains the insert effects (e.g., equalization, compression) and automation (e.g., volume fades) to be applied to each stem. For mastering engineers, this eliminates the tedious chore of rendering a project's stems manually, one by one.`n`nTo use this script, the Export Audio Mixdown window must be open (but not necessarily visible) with all desired parameters specified. The following parameter values are important:`n`n - Channel Selection: (e.g., Surround Out or Stereo Out)`n - Name: (e.g., Auto_Cubase_Export)`n - Path: (e.g., C:\Temp\Cubase\Batch)`n - Conflicts: Create Unique Filename`n - Keep Dialog Open: Yes`n`nThe following preparations are also required:`n`n - In the Project Window, mute all Audio Tracks`n - In the Project Window, select the first track to be processed`n`nMultitasking is (mostly) safe. You will receive a standard Windows alert tone 3 seconds before AutoHotKey must briefly commandeer your mouse and keyboard. Then, it will return you to your application. Rendered files are stored in your chosen location with auto-incrementing numbers appended to each successive file."
Gui, Add, Text,, Stem track count: ; Launch a pop-up window with a form and instructions
Gui, Add, DropDownList, vStemCount, 1||2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24
Gui, Add, Button, , Cancel ; The label ButtonCancel (if it exists) will be run when the button is pressed.
Gui, Add, Button, default, OK ; The label ButtonOK (if it exists) will be run when the button is pressed.
Gui, Show,, Export Stems ; Now that it's built, display the window.
return ; End of auto-execute section. The script idles until the user does something.
ButtonOK:
Gui, Submit ; Save the input from the user to each control's associated variable.
SetTitleMatchMode, 1 ; Match the start of the window title
WinActivate, Cubase Pro Project ; Activate the "Cubase Pro Project" window
WinActivate, Export Audio Mixdown ; Activate the "Export Audio Mixdown" window (might not be necessary)
WinActivate, Cubase Pro Project ; Not sure why, but we must do this twice
WinActivate, Export Audio Mixdown ; Not sure why, but we must do this twice
WinMove, Export Audio Mixdown, , 0, 0 ; Make sure the Export Audio Mixdown window is (still) positioned in the topleft corner
Sleep 500 ; Sleep for 0.5 second
Send, m ; Unmute the selected track
Loop %StemCount% {
Sleep 500 ; Sleep for 0.5 second
Click, 790 830 ; Press the "Export Audio" button
Sleep 500 ; Wait 0.5 second, just in case the computer needs time to respond
WinActivate, %Win_Active_Title% ; Reactivate the user's previously active window
SetTitleMatchMode, 3 ; Match the window title exactly
WinWait, Perform Audio Export, , 60 ; Wait for "Perform Audio Export" progress window to appear
WinWaitClose, Perform Audio Export, , 60 ; Wait for "Perform Audio Export" progress window to disappear
SoundPlay, *48 ; Warn user (Windows Exclamation tone) to stop working while script hijacks mouse
Sleep 3000 ; Give user 3 seconds to comply
WinGetActiveTitle, Win_Active_Title ; Retrieve the user's currently active window so we can restore it
SetTitleMatchMode, 1 ; Match the start of the window title
WinActivate, Cubase Pro Project ; Activate the "Cubase Pro Project" window
WinActivate, Export Audio Mixdown ; Activate the "Export Audio Mixdown" window (might not be necessary)
WinMove, Export Audio Mixdown, , 0, 0 ; Make sure the Export Audio Mixdown window is (still) positioned in the topleft corner
Sleep 500 ; Sleep for 0.5 second
Send, m ; Re-mute the selected track
Sleep 500 ; Sleep for 0.5 second
Send, {Down} ; Select next track
Sleep 500 ; Sleep for 0.5 second
Send, m ; Unmute the selected track
}
MsgBox Cubase Pro 11 has finished exporting your audio stems.
ExitApp
GuiEscape:
GuiClose:
ButtonCancel:
ExitApp