Is there a programmatical way to change the octave of WAV files

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
Post Reply New Topic
RELATED
PRODUCTS

Post

I have a load of WAV files which are to be loaded into a sampler which doesn't have an option to specify which note or octave the wave file is in.

The 'manual' fix would be to go through and print all the files again (they're synth noises) but there are quite a lot and it wold be easier if I could adjust the header and or the data in the file to prevent the manual fix.

Here's an example of the problem:
I have a lot of bass sounds some of which were rendered in the wrong octave (too low) and ideally, if I could just convert them using brute force like samplerate change or something, that would really speed up my process.

I'm guessing a batch conversion in Audacity might be the key but I thought I'd ask the sample nerds here of the options before me.

Any suggestions?
thanks! :)

Post

CinningBao wrote: Wed Feb 19, 2025 6:50 pm I have a load of WAV files which are to be loaded into a sampler which doesn't have an option to specify which note or octave the wave file is in.
[...]
Any suggestions?
Sure. Ditch that incompetent piece of shit and pick another half-decent sampler.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

If that were an option, believe me; I would. I'll just patch in a pitch shift, luckily it has that.

Post

It looks like the 25th - 28th byte (byte offset 24 if starting from zero) is the sample rate: http://soundfile.sapp.org/doc/WaveFormat/
If you want to move it an octave up just double the number, if you want to move it an octave down half (halve?) the number. You'll have to do a bit of maths juggling as the bytes are swapped (and need to be converted to hex).

11 2B 00 00 = 11,025hz
22 56 00 00 = 22,050 hz
44 AC 00 00 = 44,100 hz

My brain maths can't work out how you'd fit 88.2khz into little endian hexadecimal 88 58 01 00 maybe ?.....

Post

THERE's the hyper-nerd answer I was looking for!
thanks mcbpete, much appreciated :)
I'll chat with a pal to work out how to specify the high sample rates in hexadecimal.

Post

SOX could probably also do it, that's usually what I use for batch-applying fadeouts, trimming, resampling etc.

Post

maybe somebody could write a python script to do what you guys are talking about.

Post

I'm actually looking at SOX right now, I gather it (or part of it) was written by the python guy.
Is there a manual with all the parameters for the effects?

I was eventually able to use a pitch function in the sampler so there is no programmatical need to change these hundreds of files, thankfully!

Post

There's definitely a manual included... sox.pdf is 84 pages.

Post Reply

Return to “Samplers, Sampling & Sample Libraries”