PDA

View Full Version : Windows/Mp3tag: How to make "Master Playlists" and find missing tags



Moonbase
2009-04-04, 11:00
There has been some request on how I do "Master Playlists" to easily select years, genres, languages, BPMs, and missing tags like cover, ReplayGain data and so forth.

So if you use Windows and Mp3tag, I’m happy to give you what I currently have — its a long and two-step process, and currently only works for Windows and when using ISO-8859-1 filenames only (might need to modify it for Unicode filenames one day). Feel free to experiment with it, change it, make it work for Linux, or whatever — but please let us know by appending to this thread!

1. I open my complete library in Mp3tag (which will take a long time),

2. I mark all files in Mp3tag, then run an "Export" that writes stuff to a DOS Batch File (which will take several hours on my machine with 26,500 files).

3. I then run another batch file that converts what I get from Mp3tag into yet another batch file and executes that. This will generate a lot of M3U "playlist" files, like for years, genres, BPMs, and so forth and store the results in a M:\Music\Playlists\Master folder. This will also include some "error" playlists, beginning with "_!_", like "_!_No-Cover.m3u", "_!_No-RG-Track.m3u", and so on which I later use to correct (or sort out) the buggy files.

Here’s the list of what it currently generates:

_!_Duplicate-Tags.m3u — I use this to find duplicate Artist, Album, Title tags.
_!_No-Cover.m3u — List of files that have no embedded cover art
_!_No-OrigYear.m3u — List of files that have no ORIGYEAR specified (I use YEAR for release year, ORIGYEAR for date of first release of this track.)
_!_No-RG-Album.m3u — List of files with missing Album ReplayGain
_!_No-RG-Track.m3u — List of files with missing Track ReplayGain
_All_.m3u — Complete list of all audio files
_BPM_….m3u — BPM groups in 10’s, like _BPM_110.m3u, _BPM_120.m3u, …
_Decade_….m3u — Decades (ORIGYEAR preferred, YEAR used if not specified), like _Decade_1990.m3u, _Decade_2000.m3u, …
_Genre_….m3u — Genres, like _Genre_[unknown].m3u, _Genre_Alt. Rock.m3u, …
_Language_….m3u — Languages (the songs are sung in) in ISO 639-2 coding, like _Language_eng.m3u, _Language_eng_fre.m3u, …
_Sampled_….m3u — Sampling/Channels, like _Sampled_44100 Hz Joint Stereo.m3u, _Sampled_44100 Hz Stereo.m3u, …
_Type_….m3u — File types, like _Type_Free Lossless Audio Codec.m3u, _Type_MPEG 1 Layer III.m3u, …


It will work for FLAC, MP3, OGG, and probably even WMA and M4A/AAC files (last two not tested).

I run this on Windows/XP+SP3, the temporary batch files are currently written to C:\Program Files\Mp3tag — you will want to change this if using Vista!

Also, I use a scheme to process all "funny batch file exports" I do using Mp3tag with one and the same "Process.bat" which does some character set conversions. This "Process.bat" I invoke via a button on my Quick Launch bar, after the Mp3tag Export has finished. You have to wait until batch file processing is finished before doing another Mp3tag Export for batch file processing!

I will attach the Mp3tag "export" file and the "Process.bat" here for anyone’s use but please be sure to check the code first and modify as per your needs. Mainly, the locations for output and for storing the generated playlist files in the "Batch file - Playlist (.m3u) Master (BPM,Decade,Genre,Language,etc.).mte" file needs to be changed:

Line 1:


$filename(C:\Program Files\Mp3tag\Process-Data.txt,ansi)@ECHO OFF


Line 12:


'SET fp=M:\Music\Playlists\Master\'

Be sure not to use an apostrophe (') in this folder path and to end the folder name with a backslash (\)!

Here’s a Mini-How-To:

Grab yourself a new version of Mp3tag (http://mp3tag.de/en/), install it and set it up as per your needs.
Download the attached ZIP file and extract the files.
Copy "Process.bat" into your Mp3tag installation folder, normally "C:\Program Files\Mp3tag\Process.bat"
Create a shortcut to this in your Quick Launch bar, for ease of use. Name it appropriately so the little pop-up help will later show you what this is. I called it "Process.bat – Process MP3Tag-generated Batch Export".
Modify the file "Batch file - Playlist (.m3u) Master (BPM,Decade,Genre,Language,etc.).mte" to point to the correct locations as per instructions above.
Copy the file "Batch file - Playlist (.m3u) Master (BPM,Decade,Genre,Language,etc.).mte" into Mp3tag’s "export" folder. This usually resides under %APPDATA% and is a hidden directory, so you might want to enable display of hidden and system directories in Windows Explorer, or use START -> Run… -> type "%APPDATA%" into the "Open:" field. On Windows XP systems, this folder is usually called "C:\Documents and Settings\username\Application Data\Mp3tag\export\". You will find other ".mte" files in there.
Start up Mp3tag and check if your new Export appears under "Tools/Options…/Export". In this window, also set up the following:

[_] Append data
[_] One file per directory
[x] Show selection dialog
[x] Don’t create directories
[x] Write BOM

Click OK.
Do a test run before wasting so many hours on your whole collection!

Maybe just load one album into Mp3tag, mark all files using CTRL+A, right-click them, select "Export…" from the context menu, then "Batch file - Playlist (.m3u) Master (BPM,Decade,Genre,Language,etc.)".
Be sure that you have the following unmarked in this window:

[_] Append data
[_] One file per directory

Also be sure that the filename shown is something like "C:\Program Files\Mp3tag\Process-Data.txt".
Click OK.
When all files have been exported, click on the new "Process.bat – Process MP3Tag-generated Batch Export" button on your Quick Launch bar. A DOS window will pop up and show what it is processing.
After the window closes again, you can go to your new Master Playlists folder ("M:\Music\Playlists\Master\" in our example) and check out the newly generated .m3u playlists!

All new playlists starting with the characters "_!_" indicate some problems found (no RG values, no cover, etc.).
Be aware that, upon executing, the tool will always first delete all files matching the "_*_*.m3u" pattern in the Master Playlist folder!
If all is well, you can now load your entire collection into Mp3tag and run the playlist generation overnight. Be aware that this will take a long time.


Enjoy!

Nonreality
2009-04-04, 19:19
Thanks Moonbase,I'll have to give it a try when I have some time. I wish I'd of had this last night as I had loaded my library into Mp3tag and was working over my tags manually.