Return to Older Projects

Sonar Auto Mixdown


Working on an album or multi-song Sonar project for a client and they want MP3’s or a CD to listen to? Faced with opening a dozen different Sonar project files, going through the click, click, click to get an “Export Audio” going, then twiddling your thumbs while waiting for the Audio Export to complete only to have to repeating the process a dozen more times?

Sonar Auto Mixdown solves this problem. One click and all your songs get mixed down to MP3 or WAV. It’s not really any faster than doing it by hand, but it’s automatic so you can spend the time doing some else! It also allows you to consistently fill out the ID3 tag data in the MP3′ without having to re-type everything for each mix. Much, much cleaner and easier!

Sonar doesn’t have a built in UI scripting utility. Yes, CAL is out there, support is minimal and it doesn’t have access to much if any of the normal Sonar UI commands necessary to export a mix. So, Sonar Auto Mixdown uses the free opensource utility AutoHotKey to do most of the work.


Setup is a bit involved. Download AutoHotKey as well as the Sonar AutoMixdown zip (both listed below in the Download section.
When you unzip Sonar, the Data.ahk and the Mix.ahk need to be both copied into each of your Sonar project directories (ie the song directory, up with the .cwp file). The two BAT files need to go in the Client/Album directory (ie the directory above).

You’ll need to edit each Data.ahk file, there’s song specific information in there as well as information common to your system. The variables in Data.ahk that you need to modify are:

  • Song – Assumption that the CWP filename and the directory the CWP resides in are the same and represent the name of the song.
  • Artist – Name of the artist/client. only used to populate the ID3 tags
  • Album – Name of the album. Only used to populate the ID3 tags
  • Year – copyright year of the album, again for the ID3 tags
  • Comment – ID3 copyright string
  • CWP – Full path Where the CWP file for this song is located
  • OutDir – Full path where you what the WAV or MP3 written
  • Sonar – Which version of Sonar you are using. This must be the Window title when sonar is running!!
  • SonarEXE – Full path to the Sonar executable to use to create the Audio Export

Next, edit the mix_mp3.bat and mix_wav.bat to your liking. You’ll need one line like this for each song you want to mix down when the bat file is run:

  "C:Program FilesAutoHotkeyAutoHotkey.exe" "mix.ahk" wav

Note that this must be run with the default directory set to the current song (ie you’ll need to include CD command to position the default directory correctly before each mix.ahk run. The second parameter can be either wav for 16 bit wav file export, wav24 for 24 bit wav, or blank to get an MP3.

Now that you’re set up, double click one of the bat files and watch AutoMixdown chug thru making your mp3’s (or wav’s) while you go get a beer!

Sonar Auto mixdown utility
Download AutoHotKey from here