A Bash Script to organize Audio One-Shot Samples into subfolders based on file-name, or merge several sample packs into one.
Scenario: You have tons of ones-shot samples mixed together but the file names are somewhat descriptive, something like bla_bla_Kick014.wav or bla_HAT234.wav.
-
Makes a bunch of subfolders for the most common one-shots (Kick, Snare, Hats, Clap, etc..)
-
Searches in the folder and recursively in all other sub-folders inside it for matching filenames, for Kicks for example it searches for Kick, BassDrum, BD or KIK, whatever text comes before or after the match string is ignored.
-
Moves found files to their respective new subfolder.
-
Leaves anything that does not match in place.
-
Deletes all empty folders (including the ones created in step-1 if no matches are found)
- The folders the script creates start with an underscore, this is in case we already have sub-folders with typical names such as "Kick" or "Snare".
- It asks if we also want to move any "808" matches, this is mostly for 808 Kick/Bass but if your main folder also has claps, snares, etc with the word 808 in the file-name it might cause issues, this is why it's optional, most modern kit's only have kicks and bass with 808 in the name, older kits not really, it depends.
- Download the SampleSort.command script, open the Terminal and type
chmod u+x(including a space) drag and drop the script into the terminal and press enter (this makes the script executable).
-
For the first run right-click the script and select "Open", MacOS will tell you it cannot veryfy the Developer, thats OK becase I am not a developer 😜. After the first run you're able to just double click the excript to launch it.
-
Drag and drop the folder you want to sort into the script when asked.
-
The script will tell yout the full path of the folder, confirm it is indeed correct. âš Pay attention to this step, you really dont to accidentally run the script in the root folder of your drive and move all Kick named files... that could be a disaster:heavy_exclamation_mark:âš If it looks good type "y" for yes. ---- I advise copying a few samples to a temporary folder and testing it out first.
-
The script will also ask if you also want to move any files with 808 in their name to a the sub folder, as previously explained if this is usefull or not depends on your samples, if unsure type "n" for no.
-
Done
. . .
Extra Notes:
If having underscores before the sub folder names bothers you remmeber it's super fast and easy to batch rename in MacOS, as such:


