Slow down Charlie Parker with SoX

16 December, 2011 - 00:57
Categories:

For the saxophone music classes I'm taking, I have some exercises to play along with Charlie Parker records. Because that Bird plays pretty fast, it helps to slow things down a bit. I started with manually slowing down the tempo with Audacity, but soon I couldn't suppress the itch to automate things as I needed several slow down factors and also wanted the slow down factor in the MP3 ID3 title tag.

Here is the bash for loop I use now, mainly for my own reference (copy, edit and paste in terminal), but I guess it might be interesting in some form for other people as well.

input=perhaps.mp3
slowdowns="0.95 0.90 0.85 0.80 0.75 0.70 0.60"
 
for tempo in $slowdowns; do
  output=${input%.mp3}-tempo$tempo.mp3
  echo "$tempo slowing down $input to $output"
  sox $input $output tempo $tempo
  title=$(id3v2 --list $output | awk -F ': ' '/TIT2/ { print $2 }')
  percent=$(echo "scale=0; $tempo * 100/1" | bc -l)
  id3v2 --song "$title ($percent%)" $output
  echo done
done

This will generate files perhaps-tempo0.95.mp3, perhaps-tempo0.90.mp3, etc.

Dependencies:

  • SoX for slowing down the audio. I installed it on my Mac with Macports (port "sox")
  • id3v2 for appending the slow down factor to the MP3 ID3V2 title tag. Also installed with Macports (port "id3v2").

Post new comment

The content of this field is kept private and will not be shown publicly.
  • No HTML tags allowed
  • Lines and paragraphs break automatically.

More information about formatting options