iTunes Metadata and ReplayGain importer script (v1.2.2)
by Alexander Thomas (aka Dr. Lex)
What is it?
This is an AppleScript which is an extended version of the “Rescan QuickTime Metadata” scripts that can be found on the XiphQT Trac. Next to importing the metadata in Ogg files that XiphQT/iTunes misses (like year, track number, composer, …), it also gets the ReplayGain values if available, and converts them to iTunes ‘Volume adjustment’ values. In short, you can now both import missing metadata like track numbers and dates, and use ReplayGain on your Ogg files!
What is ReplayGain?
ReplayGain is an open source variant of the “Sound Check” feature built into iTunes. In other words, it calculates an optimal volume adjustment such that every song plays at the same perceived loudness. Because ReplayGain analyzes the entire file while Sound Check only seems to sample some parts of the song, ReplayGain generally gives better results.
Download
Download (zip archive, 60.4KiB)
To avoid problems, unzip the file with OS X' built-in unzip functionality (don't use StuffIt Expander). Read the included ReadMe file for installation instructions.
Because this requires AppleScript, it will only work in recent versions of iTunes in OS X. You also need to have vorbis-tools installed (e.g. through Fink). Of course, to play Oggs in iTunes you also need XiphQT.
Troubleshooting
Due to limitations of AppleScript, the script may not work properly if you try to run it on music files on an NFS share with non-ASCII characters in their file name. If possible, try to avoid using special characters in the names of such files (or mount your shares through afpd, which will avoid all kinds of NFS-related problems in general).
Version history
- 1.2.2 (2010-06): added an extra test to prevent processing from being aborted in case of problematic files.
- 1.2.1 (2009-10): fixed bug with positive gain adjustments.
- 1.2 (2009-09): Uses vorbiscomments for all metadata when available. No longer needs Perl to calculate the gain adjustment. Added support for sort artist and sort album artist fields. Vorbis tag matching is now case insensitive. Improved date parsing. Thanks to Martijn Pieters for these changes! Additionally, allowed x/y notation in DISCNUMBER and made disc number and total discs default to 1/1 if DISCNUMBER and TOTALDISCS fields are not specified in the Ogg file nor iTunes. This can be disabled by changing a flag in the script with Script Editor if desired.
- 1.1.4 (2007-08): fixed a bug where an error message was shown if no tracks are selected.
- 1.1.3 (2007-05): fixed a bug causing positive replaygain adjustments to clip to maximum volume.
- 1.1.2 (2007-05): fixed a bug concerning special characters in file names.
- 1.1.1 (2007-05): (updates by Frédéric Devernay) fixed a bug in the vorbiscomment paths, added support for TOTALTRACKS, DISCNUMBER and TOTALDISCS, added alternatives for ALBUMARTIST and COMPILATION.
- 1.1 (2007-05): got rid of the external Perl script (thanks to Frédéric Devernay for the idea). Added support for ALBUMARTIST, COMPOSER and COMPILATION fields. Made the script look for vorbiscomment by itself, so manual configuration should no longer be necessary.
- 1.0 (2007-04): Initial release.
Disclaimer
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Background: Why aren't all songs recorded at the same loudness and why is the ReplayGain adjustment on more recent songs often more negative?
If you have looked at the actual ReplayGain values of your tracks, you may have noted that more recent tracks often have a more negative dB adjustment. If you want to know why this is the case, another article on this site explains it in detail.