Automated Audio Mixdown/export using markers - OS X (SOLVED)

Okay, I feel this has to be possible. I just discovered that there’s an option in the Cubase 6 export dialog box to “Auto Update Name” on export (e.g. Export → "trackname**01", Export → "trackname02**). Now I already have macros setup inside cubase so that a single button sets my left and right locator based on the next marker and then prompts the export dialog box.

In the past what used to require 3-4 keystrokes/user inputs, now only requires 2, my macro/key command and a mouse click on the “Export” soft button. There has to be a way to program something to do this for me (I know there’s a solution for Windows XP users). I frequently multi-track live concerts with sets ranging from 1 - 3.5 hours in duration. That ends up being a lot songs to export individually. I hate being stuck at this computer for what can easily turn into 4-5 hours of nothing but exporting (hitting those 2 keystrokes over and over again every 4 - 10 minutes or so).

I can’t be the only one who would benefit from this, so let’s figure this out. I know some programming basics, but have no idea how to direct input to an outside program let alone input that’s dependent on the screen position of a virtual button (though I assume there’s a work around to that). Is there a Steinberg Developer’s Kit that’s not restricted to just VST based effects/instruments?

All we need is a way to input a couple of keystrokes every X minutes. If Cubase is still busy exporting a track nothing will happen, but once that X amount of time has passed again and it is finished, those 2 keystrokes would start the next track exportation. It would be much more efficient if there’s a way to read the current state of Cubase, but something as crude as what I described above would work and free me from this room I spend too much time in.

Let’s start brainstorming.

I would suggest you take a look at some AppleScript tutorials. It has very similar functionality to AutoHotkey on Windows which I’ve used to build marker-based batch export, copying markers to Google Docs, copying VST instument channel settings to temp group channels for use with Export/Import Selected Channels etc.

You can also use scripting to improve some functionality, e.g. currently Process Bars caps at 1000 unless you manually enter the bar, so I use an AutoHotkey script instead to open the dialog and input correct values based on current locator positions, so it works “as expected” with my hotkey.

Good features from the Project Logical Editor to keep in mind are the Transform / Action Target / Name: Prepend and Replace Search String. And then the corresponding Select functions based on a search string. E.g. here’s how I use it for batch export: I will add the string “#TAG#” to the markers using a PLE preset, then my AutoHotkey script will go through the markers and whenever there’s “#TAG#” present in the marker name, it’ll use that as an export marker, and finally remove the #TAG# string. This way I can select the cues I want to export from a feature film session, start the AutoHotkey script, and go grab some coffee. (by the way, MIDI tracks with no output work fine as additional marker tracks, no need to buy Nuendo… sorry Steinberg!)

I’ve found a good UI scripting tool to be so invaluable with DAW usage these days that I wouldn’t consider working without one. AppleScript is very good for this on the OS X side, so I believe you’ll find it possible to do similar things there. Hopefully someone with actual AppleScript experience here can shed some more light on how to best get going with it. Good luck!

Thank you so much for pointing me in the right direction. I’ve already created a working script and am now refining the loops that check the status of a mixdown (rather than using the crude time delay to execute another track export). There are some bugs I need to iron out and some work-arounds I may need to explore, but things are looking great. I cannot begin to tell you how happy I am to discover Applescripts and GUI scripting. This is going to free up so much time for me.

Well, after a little debugging I’m happy to say everything is working. This is simply awesome.

For those wondering, this is what the script currently does:

Once you’ve mixed a session and are ready to export tracks whose start and end points are marked, the user enters a “ProjectName” (to serve as the root/main name for each exported track) and the “NumberOfTracks” to export. Then upon execution the following happens:

  1. Locates first marker and sets left and right locators.
  2. Prompts Export Audio Mixdown dialog box
  3. Enters in user supplied ProjectName appending corresponding track number in the “Name” box
  4. Begins export (this opens a new window, let’s call it the Export Dialog Progress window)
  5. Checks to see if Export Dialog Progress window “exists” and keeps checking until it doesn’t.
  6. Once the Export Dialog Progress window is no longer present (which means the track export has finished and we’re ready to export another track) it increases the track counter variable and checks to see if it’s <= to the NumberOfTracks variable.
  7. Locates next track, preps for export (i.e. set l & r locators), and repeats steps 2-6 until step 6 is no longer true.

There are some other things, but that’s the gist of the first version. Right now the use supplied values have are hard coded, but it looks like creating dialog boxes to prompt the user on screen to enter these values shouldn’t be too hard implement.

Again, thank you for informing me of such a powerful tool. I should also mention for those interested in doing this themselves that Cubase 6 doesn’t appear to be scriptable in terms of direct Applescript support. So, you have to use the whole GUI scripting method by sending commands through “System Events”. In order to figure out what commands and attributes are available within Cubase, I downloaded a program called “UI Browser” (http://pfiddlesoft.com/uibrowser/). It takes a little while to figure it out, but not too long. All of this stuff is VERY accessible to anyone with a little programming knowledge.

Update: User supplied values via pop-up window, now working.

Hi!
Chiming in on a very late hour - I know!
But I hope the four years that have past will not have spoiled the solution you once found, jlofling!
I have been looking all over the place for a feature like this - it surprises me that it has not been build right in to Cubase! My attempts to make automator make it happen has all been unsuccessful, but now I´m all excited to stumble upon this old thread! jlofling : would you be so kind as to share your wonderful work?
Kind regards from Norway.

Hey WesselStudio, I’m glad you were able to find this thread and would be more than happy to share the script with you. The program was updated a while ago to work with Cubase 7.5 and OS X Mavericks. I also haven’t used it in a while and seem to recall a little flakiness when I upgraded to Mavericks/Cubase 7. Let me find the latest version of the script and see how it performs.

Also, please inform me which version of Cubase and OS X you’ll be using it on so that I can refine any parameters that need to be updated. It’s a pretty simple script, but it has saved me countless of hours over the past 3-4 years. On a side note, I was going to develop this script into a full fledge Objective-C program similar to what the program MEAP on the Windows side of things does. Perhaps I’ll revisit that. Give me a day or two to get back to you.

There are a lot of warnings these days, about the dangers of the internet. Apparently it`s turned in to a big bad thing. I must say that being able to find a four years old post by a guy, a complete stranger to me, that holds the solution to a long time problem, puts some weight on the positive side of the internet equation :smiley:

I am so impressed by your programming talent, and immensly thankful that you bothered to answer!

I`m on Mavericks, Cubase 7.5

Im anxious to get it workin!!

All the best,

T

Okay, sorry for the delay, but I had to type up a README file explaining how to use it along with some caveats introduced by OS X 10.9. Download the attached zip file, unzip, and double click the “Cubase Automated Export.app”. In addition to the application there is the README file and license text file (GPLv3). I’m going to go ahead and paste in the README instructions below so that you can more easily respond here to any questions that may arise.

One other thing, since I haven’t paid the $99 USD to be an official Apple developer, the program is unsigned, so in order to launch the program the first time you’ll need to press the Control key, then click on the app icon. Choose Open from the shortcut menu, then click open. This is further explained here http://support.apple.com/kb/PH14369

Again, if you run into any trouble getting the program to run properly, please don’t hesitate to ask any questions.


README for “Cubase Automated Export” version 3.5

HOW TO USE:

  1. Cycle markers must be used. If you have used single markers to set your track start and end times, use the following Key Command to auto-create cycle markers based off your single markers.

a) Open “Key Commands” (File > Key Commands)

b) Click on the “Show Macros” button at the bottom of the “Key Commands” window

c) Click on the “New Macro” button and name it whatever you like (e.g. “Add Cycle Markers”)

d) At the top of the “Key Commands” window there is a box where you can search for commands.

d.1) Type “set left locator” and click the magnifying glass next to the box. This should highlight
a command with the same name that you typed in the box.

d.2) With the command highlighted in the “Commands” section AND your macro highlighted in the “Macros” section, click the “Add Command” button (located to the right of the “Macros” section). The command should now be nested under the macro name you chose in part c (make sure the triangle next to your macro name is expanded by clicking on it. The triangle should point downwards when expanded showing your added commands).

d.3) Repeat steps d.1 and d.2, but this time search for “locate next marker”.

d.4) Repeat steps d.1 and d.2, but this time search for “set right locator”.

d.5) Repeat steps d.1 and d.2, but this time search for “insert cycle marker”.

d.6) If done correctly you should see your macro with the following command structure:
Add Cycle Markers
Transport - Set Left Locator
Transport - Locate Next Marker
Transport - Set Right Locator
Transport - Insert Cycle Marker

e) Now that we’ve made a macro to create cycle markers from single markers, we need to assign the key combination to run the macro. Again, click on the search box at the top of the “Key Commands” window. Search for your newly created macro. Using the name in the example above, we would type in “Add Cycle Markers”. Click the magnifying glass to search for your macro. It should be highlighted in the “Commands” section.

f) To the right of the “Commands” section is a black box with “Type in Key” written above it. With your macro command still highlighted, click this black box (it should turn a shade of blue), and subsequently enter in the key combination you would like to use to execute your macro. In this example, we will use the following OS X keyboard combination:
control + M
Note: You only hold down the “control key” and the letter “M”, the + sign designates that the control key should not be released until after pressing the letter “M”.

g) The box should change back to the color black and show the key combination you entered in the previous step. You can use any key combination you like, but try not to select one that is already used by Cubase. The area below this box will tell you if this key combo is already assigned to another Key Command. Once you are happy with the key combination and there are no conflicts, click on the “Assign” area with two arrows pointed upwards. This will assign the key combination to your macro command. You should see the Key combo populate the “Keys” section above the “Assign” area and the “Assigned to:” box should now display your macro key command.

h) Click “OK” and you should be finished.

i) Make sure you have a “Marker track” open in your Cubase Project Window. Now go to your first marker (if first marker is number 1, you can auto-locate by pressing: shift + 1). With the “cursor line” at your first marker, which should mark the beginning of a track, press the key combination for your macro key command (in our example, control + M). You should see a cycle marker created between your first two markers.

j) If your markers were set up to only mark the beginning and end of your tracks/songs (and not other areas of interest in your project), you should be able to quickly apply cycle markers to all tracks/songs by continuing to press your macro key combination until it reaches the last marker. That is, the macro should automatically move the left and right locators after each cycle marker creation. If for some reason this does not work, you will need to manually go through your project and add cycle markers by setting left and right locators and pressing the “Add Cycle Marker” button on the “Marker Track”. Hopefully, the macro will work correctly and will save you some time. Now on to using the Auto Export Script/App

  1. With your project prepped and ready to go, open the “Audio Mixdown” window under File > Export. Make sure the file format and audio engine options are set to your desired settings and then close the “Audio Mixdown” window.

  2. Click on the “Cubase 7.5 Automated Export” program. You should be presented with a dialog box asking for the Project Name (default name is “test”). This name serves as the root name of the exported tracks (e.g. ProjectNamet01, ProjectNamet02, ProjectNamet03, etc.). Click “OK” once you’ve entered a name.

  3. Another dialog box should present itself asking for the number of tracks in the project. Enter the total number of tracks you wish to export and click “OK”.

  4. A final dialog box should follow asking for the starting track to begin exporting. Usually you can leave this at 1, however, in the event that something messed up and say only the first 5 tracks/songs out of 10 exported correctly, instead of having to re-export the first 5 tracks, you can re-run the script and have it begin at track 6 (or whatever your case may dictate). After entering in the starting track #, click “OK”.

  5. If all goes well the Cubase window should come to the front and your project should begin Auto Exporting. However, for security purposes, OS X 10.9 changed the way certain applications can control your computer, so you may end up seeing two dialog boxes, one stating:

“‘Cubase Automated Export.app’ would like to control this computer using accessibility features.
Grant access to this application in Security & Privacy preferences, located in System Preferences.”

The other dialog box should read “Cubase Automated Export is not allowed assistive access”. Click “OK” to close this dialog box.
Screen Shot 2015-02-16 at 2.04.02 PM.png
The first dialog box should give you an option to click on the “Open System Preferences” button at the bottom of the box. This should bring you to the “Accessibility” section of the “Privacy” tab for the “Security & Privacy” window. In the event that you don’t see this option or only the second dialog box appears, you can navigate to this section by going to “System Preferences” > “Security & Privacy” > “Privacy” > “Accessibility”.

Here you should see a list of apps that can control your computer. We need to click the check box for “Cubase Automated Export.app”*, but before you can do this, you’ll need to click on the “Lock” at bottom left corner of the “Security & Privacy” window. Enter your administrator username (should already be entered under Name) and password to unlock this area to modify settings. Once unlocked click the checkbox next to “Cubase Automated Export.app”. Relock or simply close out the “Security & Privacy” window.

  • It’s possible that instead of “Cubase Automated Export.app” you may see an entry with a random string of text (e.g. DEE0DB71-5DE6-4291-80B6-826C32C2E4F2.app, also note that only part of this random string may be visible). I’m not sure why this happens, but as long as it has the correct icon (black PureTone Recording logo), you should be fine checking the box for this entry.
  1. Once the application is authorized, re-run the program and follow steps 2-5. You shouldn’t have to re-authorize, however, this has been an area of inconsistency and you may end up having to re-authorize the program more than one. If this occurs please contact me at:

info@puretonerecording.com > with the subject: CUBASE AUTOMATED EXPORT.
Cubase Auto Export v3.5.zip (391 KB)

I am really thankful for all your effort creating and sharing all this.

However, I´m experiencing some difficulties that I am hoping you can help me with:

Everything acts as suspected until the actual exporting process starts. But the process - that gives the impression to work its magic - results in any number OF THE SAME TRACK! Clearly this is not what I want, nor how the program was intended to work…

As the process runs, I can see the playhead/cursor in cubase move forward in a stepwise manner, from cyclemarker to cycklemarker, but the left/right locator never moves. Thus, it is the region marked by the locators that gets exported, regardless of the playhead.

What box can I tick to get the locators follow the playheads movement through the cycle markers?

The issue must be in the Key Command used to “Recall Cycle Marker X” or the program’s attempt to pass this command to Cubase. I may be incorrectly assuming that by default it is “Shift+Num 0”. It could also be related to the fact that the ‘0’ (zero) key above the standard QWERTY keyboard is different from the number pad ‘0’ (zero) key (number pad referring to the area on the keyboard to the right with the digits 0-9 arranged in a grid). To complicate things further, there may be issues related to your keyboard layout being set to something other than U.S. (though I don’t think this is it).

Open up ‘Key Commands’ (File > Key Commands) and type in “Recall Cycle Marker X” in the search box at the top and hit enter. If the assigned key combination is anything other than “Shift+Num 0”, change it to that, otherwise let me make a quick and minor change to the script and re-upload it for you.

Here’s an updated version of the program. Note that you’ll have to re-authorize the program like you did previously to grant it accessibility features.

EDIT: Just to let you know what was changed, v3.5 contained the following code to pass the key command “Recall Cycle Marker X” (which again should be assigned to “Shift+Num 0”):

keystroke "0" using {shift down}

While this worked on my end, it’s hard to tell which version of ‘0’ (zero) is actually being passed to Cubase. So v3.5.1 uses “key code 82” which refers to the numpad ‘0’:

key code 82 using {shift down}

Cubase Auto Export v3.5.1.zip (392 KB)

It works, it works, IT WORKS!!

It is so beautiful to see the wonders of this script: the computer is actually doing something on its own, saving man for a lot of work! (This is the way it should be, of course…) ((might I add; the number of tracks exported in this session was no less than 151))

The issue was related to the new default path for key command “shift+ num 0”. In Cubase 7.5 it is for some reason mapped to “stop preview”. When I wanted to reassign the shortcut, I actually had to download KeyRemap4mac to be able to type “num 0” - apple has removed this function completely from the new retina-series. Sometimes I do not understand the way they prioritize!

Anyway: I am really grateful for all the help I got on this one, and can already think of many, many future projects where this will come in handy!

Cheers!

T

That’s AWESOME! I’m really pleased to see this little program/script helping others out. When I was routinely multi-tracking/mixing/releasing live concerts on a weekly/bi-weekly basis, I felt like I was going to go crazy during the exporting process. So much wasted time sitting around the computer waiting for tracks to finish exporting. Most projects contained on average 20-30 tracks, spanning 2-3 hours worth of material. I imagine sitting around to export 151 tracks to be even more excruciating.

It never crossed my mind that most new Macs don’t come with a full size keyboard making it nearly impossible to assign any of the number pad keys to Cubase’s key commands. That must have been frustrating. Glad you found a solution. It’s also been such a long time that I don’t remember which Key Commands I’ve re-assigned from the defaults (I think I was using Cubase 4 when I first wrote the script, who knows how the defaults have changed since that version and which ones I’ve carried over from previous builds).

Let me know if you run into any odd behavior with the app or have some suggestions for additional features. Same goes for anyone else who wishes to use this.

For what it’s worth you can export cycle markers in Nuendo, see the bottom left hand corner of attachment. If memory serves me this was added in Nuendo 4.

Nice work on your AppleScript, I just downloaded this and plan to use this. I use AppleScript a lot in work flow, it would be neat if you didn’t have to GUI script in Cubase but that will probably never change. If Cubase added more accessible functions for the blind then there would be a lot more functions we could access. As it stand right now there are many elements that you can not reference since it is not really a very friendly app for the blind like advertised. Funny thing is if it were it would also added the sighted.

Thanks for not locking the app you made, I was able to update it for Cubase 8 and use my shortcut of Command+Control+Shift+pad period for locate cycle marker. Shift+pad zero doesn’t seem to be a default for Cubase for locate cycle marker was it for you?

I wonder if AppleScript can let you type in your key combination and use that for it’s code. I guess you could always enter a key and then have the four modifiers selectable as a choice for the app.

Thanks. The GUI scripting approach was a bit of a pain and it would have been so much nicer if Cubase was natively scriptable. I ran into some really annoying issues early on that seemed to only affect prior versions of Cubase where bringing up the ‘Export’ window wouldn’t always result with the ‘Name’ field being the “starting position”. The script is just “tabbing” through the different fields at fixed intervals, so if the starting position changed, the script fails. It would be so much better if I could actually access each field directly. Oh well, at least since Cubase 7, I don’t recall this being a problem anymore.

No problem, I’m by no means a seasoned programmer so if anyone can add to the script or recommend changes, I’m all for it. In regards to the “locate cycle marker” key command, I just went in to Cubase 7.5 and hit “reset all” in the key commands window, and the “Recall Cycle Marker X” doesn’t have a key combination assigned to it. To Recall Cycle Markers 1-9 the defaults are Shift+Num 1 - Shift+Num 9, respectively. So that’s probably why I assigned it to Shift+Num 0.

Yeah, that’s not a bad idea and shouldn’t be too hard to implement.

Hello All,

This is sounding extremely interesting to me, especially because I have to export, by tomorrow night, 140 separate voice-over files from a project where I have created cycle markers to define the length and name of each clip. Being able to use the script you wrote would be an incredible timesaver for me. Unfortunately I’m running Cubase 8 and have no knowledge of applescript. How can I go about using this script in Cubase 8 ? Any help would be greatly appreciated.

Let me make a quick modification to the script. I don’t own a copy of Cubase 8 so I can’t test it, but hopefully there aren’t many changes in the system events in regards to the Cubase name space and a simple change of

activate application "Cubase 7.5" --Bring Cubase to front

tell application "System Events" to tell process "Cubase 7.5"

to

activate application "Cubase 8" --Bring Cubase to front

tell application "System Events" to tell process "Cubase 8"

will be all that’s necessary. Give me a few minutes and I’ll have a new Cubase 8 version of the script uploaded.

Try this version of the script. Be sure to follow the directions in the README.txt.

Note: I changed the version format so that the first two numbers correspond to the Cubase version the script is meant to address.
Cubase Auto Export v8.0.1.0.zip (216 KB)