iTunes Match vs original comparison script
2012-02-22 23:16:45
Hello all, I've been lurking about here for a while and thought I'd contribute a script I knocked together. It takes my old mp3s, calculates their DRC using http://www.pitchtech.ch/DRC-Meter/ , and then does the same with the 'new' m4a versions. Hopefully it will be of use to some of the folk on here. I use it to find any tracks where the old version is 'better' by being less compressed/loud etc. Further explanation here: http://www.tristancollins.me/2012/02/22/it...-analysis-tool/ #!/bin/sh # Script to compare my original mp3s to the new 'matched' versions # Copyright © 2012 W Tristan Collins - All Rights Reserved # Do what the hell you like with this. SAVEIFS=$IFS # save the old IFS variable IFS=$'\n\b' # change IFS to cope with spaces in paths/filenames oldFILES=source/* # directory of old mp3s newFILES='/Users/Tristan/Music/iTunes/iTunes Music/*' # iTunes music directory extension='.mp3' # set the extension we are looking for, in this case mp3 # prepare output file echo Name,Old Dynamic Compression,New Dynamic Compression > out.csv echo Name Old New for file in $oldFILES # for each of the original mp3s do oldNAME=`basename $file $extension` # strip the path and extension newNAMEarray=(`find $newFILES -name $oldNAME\*`) # find the corresponding new file for i in ${newNAMEarray[*]} do # echo "$i" # this is where the comparison could be done # This is a measure of Dynamic Range Compression # using [url=http://www.pitchtech.ch/DRC-Meter/index.html]http://www.pitchtech.ch/DRC-Meter/index.html[/url] # Smaller numbers are better (less obvious compression used) procold=$(java -jar DRC-Meter/DRC-Meter.jar "$file" | tail -c 5) procnew=$(java -jar DRC-Meter/DRC-Meter.jar "$i" | tail -c 5) echo $oldNAME $procold $procnew echo $oldNAME,$procold,$procnew >> out.csv done done IFS=$SAVEIFS exit 0 I'm not an expert on these things so would welcome any input or help extending the script further. Cheers, Tristan