Batch processing on multiple folders?

I have 40 folders each one with lots of SFX, so when i need to apply som chain, like mono to stereo or whatever, i have to apply 40 times, every time i want to add something to that sounds which is a pain.

At the momento only did a few times for the MonoToStereo thing to work with them, but in future, is there any fix for that?

The idea i select X folder, then for each subfolder will create a folder called “macro-output” with the new files. Or there is any other workaround/option i’m missing?

I don’t think Macros will switch between folders.

Koz

If you know Python, then you could write a Python program to control Audacity via “scripting commands” Scripting - Audacity Manual
Audacity 2.3.2 includes mod-script-pipe, so you only need to enable it in Preferences, then restart Audacity (Scripting - Audacity Manual)

And if my code skills are 0 ? :unamused: , Not will be possible add on new audacity versions?

There are no plans to add multi-directory support to Macros.

Damn, what a shame.

I saw there is a subforum for Macro Scripting / Batch processing, will be correct if i ask/request this there? Maybe other people with same problem already did it and can share? I know you said Python but seems is the most close subforum to post this. What you think? Let me know.

will be correct if i ask/request this there?

You could, yes.

Being professionally “glass half empty,” I can see problems with making a tool like this too handy. One wrong move or command in the wrong place and you could destroy your machine. rm . comes to mind. Destroy everything you can find. Many of those suicide errors are trapped out now, but they didn’t used to be.

Koz

Ok, I see, now you scared me XD.

Then people that uses audacity, how they do batch processing on multiple folders in a safe way ¿?

One of my ideas i tried is what i do in the explorer when i want pick multiple video files in different folders.

1.- Go to the main folder
2.- Put .avi in the search
3.- Will appear all the files listed in all subfolders with .avi

So I pick them and move all the files from all the subfolders easy to another way.

But the audacity window not have that search feature, wonder if maybe can be added, so you go to a folder, set “*.*wav” and will appear all the wav files from that subfolder , so select all and process. No idea if can be done, just saying in case is possible.

One workaround (I’ve only tested on Linux) would be to create a folder containing links to each of the files that you want to process, then apply the Macro to the links. However, a limitation of this approach is that all of the processed files will still be in one export folder (the “macro-output” folder), so you need to be careful about duplicate names.

A workaround that works on all platforms is the obvious one - copy or move all of the files that you want to process into one folder.

I’m working with a SFX pack with +40 folders and +1700 .wav right now.

That means put all in one folder (“easy” using the search trick). But after apply the batch, i gonna need to pick each category from files and send to one of the erach 40 folders one by one :S .

Well, thanks for the help!, will investigate to see if there is a better workaround for this.

Perhaps use a program that can do batch file renaming, and add the name of the folder to the start of each file name. That will make sorting the output files easy.

We do have a “feature request” logged on the Audacity wiki:

Improvements to the “Macro” (batch processing) feature

  • Recursive selection of all files in one or more directories

I presume that would allow you to do what you want to do?
I can log your interest in that feature (we keep a count of “votes” for each feature request so as to give the developers an idea about which new features are most popular).

Oh yes please! exactly what i’m looking for!

Done.
I’ve also “voted” for it myself as I don’t think it makes Macros any more difficult for users, and processing directories recursively is a common feature in other batch processing apps.

I don’t think that’s a big “danger” because Audacity is not acting directly on the files - Importing makes a copy. I expect that it would also be fairly easy for the developers to add a check for the total number of files selected, and limit that number to a reasonable (large but safe) number.

For my own highly personalized version of Audacity (still at 2.0.6 - no macros back then just regular chains, Windows-only) I added this ability. The way I do it is to process a plain text file with a list of all files I want to process. I create this text file Using a Batch file:

chcp 65001

CD /D E:\Albums
del songs.txt SONGSaa SONGSaa.txt SONGSab SONGSab.txt SONGSac SONGSac.txt SONGSad SONGSad.txt SONGSae SONGSae.txt SONGSaf SONGSaf.txt SONGSag SONGSag.txt

CD /D "V:\Albums\Bands"
dir /S /B *.mp4 >"E:\Albums\songs.txt"
dir /S /B *.m4a >>"E:\Albums\songs.txt"
dir /S /B *.webm >>"E:\Albums\songs.txt"
dir /S /B *.flv >>"E:\Albums\songs.txt"
dir /S /B *.wmv >>"E:\Albums\songs.txt"
dir /S /B *.aac >>"E:\Albums\songs.txt"
dir /S /B *.ogg >>"E:\Albums\songs.txt"
dir /S /B *.wav >>"E:\Albums\songs.txt"

CD /D "V:\Albums\compilations"
dir /S /B *.mp4 >>"E:\Albums\songs.txt"
dir /S /B *.m4a >>"E:\Albums\songs.txt"
dir /S /B *.webm >>"E:\Albums\songs.txt"
dir /S /B *.flv >>"E:\Albums\songs.txt"
dir /S /B *.wmv >>"E:\Albums\songs.txt"
dir /S /B *.aac >>"E:\Albums\songs.txt"
dir /S /B *.ogg >>"E:\Albums\songs.txt"
dir /S /B *.wav >>"E:\Albums\songs.txt"

CD /D "V:\Albums\soundtracks"
dir /S /B *.mp4 >>"E:\Albums\songs.txt"
dir /S /B *.m4a >>"E:\Albums\songs.txt"
dir /S /B *.webm >>"E:\Albums\songs.txt"
dir /S /B *.flv >>"E:\Albums\songs.txt"
dir /S /B *.wmv >>"E:\Albums\songs.txt"
dir /S /B *.aac >>"E:\Albums\songs.txt"
dir /S /B *.ogg >>"E:\Albums\songs.txt"
dir /S /B *.wav >>"E:\Albums\songs.txt"

CD /D "V:\Albums\Musicals"
dir /S /B *.mp4 >>"E:\Albums\songs.txt"
dir /S /B *.m4a >>"E:\Albums\songs.txt"
dir /S /B *.webm >>"E:\Albums\songs.txt"
dir /S /B *.flv >>"E:\Albums\songs.txt"
dir /S /B *.wmv >>"E:\Albums\songs.txt"
dir /S /B *.aac >>"E:\Albums\songs.txt"
dir /S /B *.ogg >>"E:\Albums\songs.txt"
dir /S /B *.wav >>"E:\Albums\songs.txt"

CD /D "V:\Albums\Singles"
dir /S /B *.mp4 >>"E:\Albums\songs.txt"
dir /S /B *.m4a >>"E:\Albums\songs.txt"
dir /S /B *.webm >>"E:\Albums\songs.txt"
dir /S /B *.flv >>"E:\Albums\songs.txt"
dir /S /B *.wmv >>"E:\Albums\songs.txt"
dir /S /B *.aac >>"E:\Albums\songs.txt"
dir /S /B *.ogg >>"E:\Albums\songs.txt"
dir /S /B *.wav >>"E:\Albums\songs.txt"

cd /d E:\Albums
D:\GnuWin32\bin\split.exe -l 475 E:\Albums\songs.txt SONGS

rename SONGSaa SONGSaa.txt
rename SONGSab SONGSab.txt
rename SONGSac SONGSac.txt
rename SONGSad SONGSad.txt
rename SONGSae SONGSae.txt
rename SONGSaf SONGSaf.txt
rename SONGSag SONGSag.txt

I then use my specially-coded version of Audacity to process each of the resulting text files (each of which will list 475 tracks - about the maximum that Audacity 2.0.6 can handle).

Audacity’s Chains feature puts the modified file in a new folder (can’t remember its name off the top of my head) in the original file’s folder, but I prefer to keep the modified track in the original folder and put the original file in the new folder (whose name I have changed to “remnants”).

I have use this to process literally tens of thousands of files over the years with no problems. The process relies on using your most recently used Chain and, other than making sure that that most recently used Chain is the one you want to apply, the process is almost completely automated. When the application runs it pops up a requester dialog asking you to pick out the text file you wish to process (it has Browse and Cancel buttons plus a couple others) - If you choose to “Cancel” you just get a fairly standard Audacity 2.0.6 application.

If you want the source code or just the application, let me know and I will provide a Dropbox link.

Ey! thanks Steve for that!

Edgar, well, that seems a bit complicated also i’m using macros for lot of things so i need this version, so i guess i will wait for the recursive feature, but thanks for the offer!

In Audacity 2.3.2 it would be possible to write a Nyquist-Macro to process files in a directory recursively. The relevant Nyquist commands are:
SETDIR https://www.cs.cmu.edu/~rbd/doc/nyquist/part19.html#index1719
LISTDIR https://www.cs.cmu.edu/~rbd/doc/nyquist/part19.html#index1721

Some info about Nyquist-Macros here: https://manual.audacityteam.org/man/nyquist_macros.html

Hi Edgar, you would do me favour with the source code or just the application.
Thanks, Adlain
My mail: adlain.muziekpaleis@gmail.com