beaTunes News

Thursday, September 17, 2015

Destemming Stems

DJ Techtools just ran a great story that explains how to extract individual stems from stem files using FFmpeg and Audacity. Their well working approach is a mixture of installation, configuration and drag and drop.

If you are using OS X and are comfortable on the command line, you might appreciate a different approach, allowing you to batch destem your stem files to a format of your choice. To do so, simply install FFmpeg, so that it is in the PATH. Then download the BASH script and make sure it's executable (chmod u+x and in the PATH as well (if you don't know how to do that, please do not ask me, but Mr. Google.).

Once installed, the script is pretty self-explanatory. Open a terminal window, go to the folder that contains your stems and type:

MyMac$ aif .

This will destem all files in the current directory and encode the results in AIFF. Other formats are possible. To get a list, simply type:


Yep. Just don't give it any arguments. Explicitly supported are: m4a | flac | wav | ogg | aif.


PS: The script may fail, if there are less/more than 4 stems plus the original in a file. It really isn't the sharpest tool from the shed.

Image by Joshua Rappeneker

Labels: ,


Blogger Tyler said...

Thank you so much! As someone who is starting to get familiar with the command line this was a great exercise in getting ffmpeg up and running and understanding bash (especially from your example). Best of all, I get the satisfaction of quickly extracting the separate tracks from the NI stem file! Thanks so much for sharing this!

September 17, 2015 at 12:22:00 PM EST  
Blogger Spencer "Thunderball" Thayer said...


September 17, 2015 at 12:57:00 PM EST  
Blogger beaTunes said...

Thanks, guys. Appreciate it!

I have to say, though, I'm far from being a BASH expert. So take that script with a grain of salt. I'm fairly certain I broke some common conventions out of ignorance.

September 18, 2015 at 2:05:00 AM EST  
Blogger Unknown said...

Hello, really i´m not an expert about command lines and this script, any help? Reallu interested on this.

May 10, 2016 at 1:47:00 PM EST  
Blogger beaTunes said...

@Juanfra: What *exactly* do you need help with?

May 10, 2016 at 1:52:00 PM EST  
Blogger beaTunes said...

@Juanfra: I.e., what did you try, how did it fail, etc.

May 10, 2016 at 1:55:00 PM EST  
Blogger Unknown said...

Thanks @beatunes for your reply, really i would like to get a tutorial how to do it, i said really never work with command lines, codes, etc.. And don´t know how to do it. Totally rookie :(

May 15, 2016 at 8:36:00 AM EST  
Blogger beaTunes said...

Please simply google "OS X command line basics" and you'll find a ton of tutorials explaining command like "cd, ls, mv, pwd" etc.
Once you are familiar with those, you need to figure out what the PATH environment variable is for. There happens to be an article about that at

So to use the script, you need to add both the FFmpeg executable and the script to your PATH. You can check whether that's the case by simply opening a Terminal window and typing either or ffmpeg. If you get the message "command not found", it's not in the PATH.

To run the script, you need to make sure it is "executable". You see whether it is with "ls -l" and you can change its permission with the chmod command. More info at

Once you are certain both programs are executable and in the path, you can start using the script.

If you get stuck with this, feel free to post concrete questions here, but my impression is, that you're better off using a site like or simply google the web for a tutorial. None of the stuff I mentioned in the blog post is very special and has been documented a hundred times.

Good luck!

May 15, 2016 at 8:56:00 AM EST  
Blogger Unknown said...

Thanks a lot!

May 15, 2016 at 9:36:00 AM EST  

Post a Comment

<< Home