Software to sort one shot wave files based on notes

Hello!

I bought a sample pack that comes with a truck load of one shot samples. All oneshot samples are named like this: “C2 old school short decay_bip.wav” where the filename always starts with the note and the octave.

I want to create various chains out of these files (most probably using Octachainer) but dragging and dropping files one by one starting from the lowest C to the highest note to Octachainer is super hard and very prone to error.

So I was wondering if there’s an easy way to at least batch rename them so it can at least be smt like this, therefore at least I can sort alphabetically and it’ll get ordered beginnig from the lowest C within the sample pack/instrument

01_C2 old school short decay_bip.wav
02_C#2 old school short decay_bip.wav
03_D2 old school short decay_bip.wav

so on and so forth.

Does anybody know a tool where I can do this?

Alternatively, if you know any sampler software that can gather those files, analyze and populate it’s keyboard range automatically depending on the pitch of the samples within a folder, I’m also okay with that since I can simply write a chromatic pattern in Live as MIDI, and export the result as if I “chained” them manually.

Essentially I’d like to avoid renaming hundres of files OR dragging and dropping said hundreds of file to Octachainer one by one.

Please let me know if you know some sort of software that can help with this. Cheers!

are you using windows?

ah sorry forgot to mention that. i mainly use macOS but i have a windows and a linux machine as well so anything goes i guess :sweat_smile:

don’t know anything about macs except that they make for delicious fruit salad.

you can probably do something similar to what you want with batch updates in windows using command prompt or power shell, I’ve had better luck with power shell.

but…
.
.
.
.
.
.
.
.
.
.
.

it will take a little learning. nothing free is easy, nothing easy is free.

How to batch rename multiple files on Windows 10 | Windows Central

Batch renaming is actually absurdly easy on macOS, but i need a custom rule that goes through all the files and sort them by the note name (so not C2, C3, C4, C#2, C#3, C#4 but C2, C#2, D2 … etc) looks like it’s not possible even with powershell. I think I’ll go the route of writing a custom Automator script.

Thanks anyways!

I think the closest you could get is a batch rename with enumerated files, you would have to have a broader system to make it useful. If you need something so specific you will need to write a script, but I don’t know how to do that sort of thing so I can’t be of any further service and so I bid you, adieu.

I use this software to do all sorts of batch renaming. Very powerful:

https://www.advancedrenamer.com/

And yes, it was worth every penny of the $27 CAD I spent on it.

1 Like

I could be wrong but it seems to me highly unlikely that that software will parse the file name, find and understand the note naming convention used by the maker of those files and then arrange them in pitch order ?

EDIT: Although this feature might allow it, if you were to write the associated javascript

Generate new file names from JavaScript

1 Like

eventually I went with a combination of Renamer (which has some RegEx features) and macOS’s own renaming tool. It wasn’t a 2 click solution but I was able to sort hundreds of one shots and chords/stabs based on their key and created chains with OctaChainer in about an hour.

5 Likes

I use a tool called preset maker. It can create presets for live as well as other formats. The same ones who make kit maker made this one, pretty nifty. In fact i started using them both yesterday to make kits for my MPC.

1 Like

@boorch, I have a python script that does a renaming very similar to what you need. If you want it, I can adapt it to your sample names and upload it here.

1 Like

hey @joanq yes i’d appreciate it very much! thanks in advance!

I’m out this evening, but will try to look at it tomorrow.

1 Like

If you can use Bash, this might be a solution. It’s a function that converts a note name to a MIDI note number (3 digits with 0 padding). In case of error, “NUL” is echoed.

Example.

$ source <(curl https://gist.githubusercontent.com/dagargo/656106d61c250b0ec229e62b00fd6c6e/raw/a66f2102ea2e1131e48678c814359abe5637e667/note_number_from_note_name.sh 2> /dev/null)
$ note_num_from_note_name "G#3" 2> /dev/null
068

If you want to rename all the wav files in the current directory, just do this.

$ for f in *.wav; do mv "$f" $(note_number_from_note_name "$f" 2> /dev/null)_"$f"; done
1 Like

this is amazing! thank you so much!

This is the python script. Just move/copy it to the folder where you have the samples to rename, and run it (python noms.py or similar).

It will show the new names for the files and ask for confirmation before doing anything.

Anyway, as it a new script only tested by myself, I advise you to make a backup copy of the samples, just in case.

noms.py (836 Bytes)

1 Like

Thanks a lot!

1 Like