Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change pitch of multiple audio files with Sox

I am intending to take my entire music collection and change the pitch from the original recorded a=440hz to the more natural sounding/feeling a=432hz.

For those of you who are not familiar with this concept, or the "why" for doing this, I highly encourage you to do a google search and see what it's all about. But that is not entirely relevant.

I understand that I could even take Audacity and one-by-one, convert and re-export the files with the new pitch. I have tried this and yes, it does work. However, my collection is quite large and I was excited to find are more fitting command-line option, SOX. Any idea ?

like image 219
user2946608 Avatar asked Nov 01 '13 22:11

user2946608


2 Answers

$ sox your_440Hz_music_file.wav your_432Hz_music_file.wav pitch -31
like image 134
Prana Avatar answered Sep 22 '22 20:09

Prana


This is asking way more than one question. Break it down into subproblems, for instance:

  • how to batch-process files (in whatever language you like: perl, bash, .bat, ruby)
  • how to structure a set of directories to simplify that task
  • how to change the pitch (with or without changing duration) of a single audio file
  • how to detect the mean pitch (concert, baroque, or whatever) of a recording of tonal music, by using a wide FFT, so you don't accidentally change something that's already 432 to 424

As you work through these, when you get stuck, ask a question in the form of a "simplest possible example" (SO gives much more advice about how to ask). Often, while formulating such a question, you'll find the answer in the related questions that SO offers you.

like image 30
Camille Goudeseune Avatar answered Sep 23 '22 20:09

Camille Goudeseune