Kodi Community Forum
Musicbrainz Picard Tagger: My Tips And Things - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (/forumdisplay.php?fid=116)
+--- Thread: Musicbrainz Picard Tagger: My Tips And Things (/showthread.php?tid=63061)



Musicbrainz Picard Tagger: My Tips And Things - SleepyP - 2009-12-01 22:35

Like many XBMC users, I have a large music library. Recently I've been working on fixing up & standardizing the tags and stuff so that everything is "nice". I had been using a combination of tools, but in the past couple of days I figured out how to automate & streamline as much as possible so that Picard now does that bulk of the work automagically. Picard itself is an open source multi-platform tagging & naming tool. It's integrated tightly with the MusicBrainz database.

MusicBrainz is an open source music database which has been around for years. They allow for Wiki-style editing of pretty much an information stored in their database, and have APIs which allow all sorts of programs to talk to & use their information. They've become one of the best and most standard sources of music info. Some of the features:

-Version 0.12 of Picard can now generate Music IP "PUID" numbers for each track. These are basically a fairly unique string of numbers of letters generated based on the acoustic properties of a given track. In theory if you have two rips of a track in different formats, as long as they were from the same master CD, they will have the same PUID number. These ID numbers are stored in the MusicBrainz database and can be searched for, so Picard can actually identify a track even if it has no tags and the filenames are wrong, based simply on how the track sounds.

-Each "Release" (CD, Vinyl, Digital Release, etc) and each track is given its own unique MusicBrainz ID#. There are a variety of interesting ways that these can be used, and they've been adopted by other systems (like Last.fm). This also makes it fairly easy to re-tag or update the tags on stuff.

-On popular releases, there's usually tons of extra info, like the record label, ASIN #, Amazon URL, song writer credits, etc. This is the main reason I use it.

Picard checks the tracks you give it for all tagged info, plus song length, plus it tries to extract info from the file name. Then it tries to match the files you have given against the Musicbrainz database. It color-codes the results so you can tell how confident it is that the matches are correct, and also if it has found all the tracks from a particular release. You can preview what will be saved and make changes before saving the tags. Picard is also extensible via Python plugins (sound familiar?). These allow the tag info from MusicBrainz to be processed and formatted in a variety of ways. People have also written plugins to get info from Last.fm and other places.

My Settings & Changes
-First, turn on "Automatically scan all new files" in Options > General. This will immediately "scan" the files you give to Picard and begin attempting to get data for them. Speeds things up for me and saves a click.
-Options>Metadata: Enable "Translate foreign names to English where possible".
-Options>Tags: I set Tag Compatiblity to ID3v2.3 UTF-16. This is mainly to ensure all my stuff will work properly on my iPod Touch, which has some issues with ID3v2.4.
-I have turned on the file renaming and moving options.
--I have "folder.jpg, album.nfo" in my "move additional files" option.
--my Filenaming format strings look like this:
Standard Artist:
Code:
$replace($if($eq($left(%albumartist%,4),The ),%albumartistsort%,%albumartist%)/%albumartist%-$left(%date%,4)-%album%$if(%discnumber%,-CD %discnumber%,)/$num(%tracknumber%,2)-%title%,:,)
Various Artists:
Code:
$replace(VA/%album%-$left(%date%,4)$if(%discnumber%,-CD %discnumber%,)/$num(%tracknumber%,2)-%artist%-%title%,:,)

Lots of scary looking code in there, I know. Picard has its own scripting language, which can be used to process your filenames. These strings result in the following filenames:
-A folder is generated per-artist using the Album Artist tag for the album. If that tag begins with "The ", then that string is removed and stuck on the end. This means "The Beatles" will get a folder named "Beatles, The". This just makes it easier to browse the library root from a regular folder browser.

-There is one folder generated for each album. The format is <Album Artist>-<Year>-<Album Title>. Leading "The "'s are NOT processed at this level and are left alone. Example: The Beatles-1963-Please Please Me.
--Multiple-Disc releases are handled as well. The Disc Number is found in the album title and removed, then inserted into the folder name.
Example: The Beatles-1968-The White Album-CD 1
--In this example, the actual Album Title tag for these files will simply read "The White Album", keeping the Albums list clean, but still allowing for intuitive browsing, like when you want to grab only the first CD and stick it on an MP3 player...
-Track titles are simple: 01-Back In The USSR.mp3

For Various Artists / Compilations, I handle things pretty simply. I still generate an "Artist Level" folder, its just named VA. This keeps the filepath short and puts all the comps together in one folder. Each compilation gets its own per-CD folder, <Album Title>-<Year>. Example: Afro Samurai Resurrection Soundtrack-2009
-Multiple discs are handled exactly the same as above, with "-CD #" appended to the end of the album title. Example: 8 Mile Soundtrack-CD 2-2002
I find this layout makes it easiest to browse for stuff at the folder level. I was using the same formatting as my standard folders, but that results in stuff like "Various Artists-2002-8 Mile Soundtrack-CD 2", which is very hard to browse through and is also a much longer filepath for no good reason.

The various artists tracks simply have the track artist inserted before the track title, like this: "03-50 Cent-'Till I Collapse Freestyle.mp3"

Plugins
I wrote a new plugin for Picard because I hate the way "Featured Artists" are handled in MusicBrainz. My plugin searches the track titles for the phrase "Feat. " and if its found, it wraps that stuff up in parentheses and replaces "Feat. " with "Featuring ". I also tweaked the Disc # plugin to be case insensitive, since some releases in MusicBrainz are tagged as "Disc" and some "disc". In addition to these tweaks, I also use the Title Case plugin to capitalize the words the way I like them.

The result of all this stuff is a tagging / renaming workflow that looks like this:
-Drag & drop the files to be processed into the Picard window.
-Picard automatically starts scanning them and generating fingerprints as well.
-the tracks are automatically matched to their results.
-When the entire album is matched, I click "Save".
-The tracks are now tagged and named properly in a way that XBMC (and any other media player) should be happy with.

Note: I still use some other tools to handle my album art, lyrics tags, and random tag cleanup. However, Picard is pretty damned good.
Links:
-Tweaked Disc # Plugin
-My Featured Artist 2 Plugin
-Picard Tagger

Does anyone else use Picard? Input? Questions? Smile


- weldon - 2009-12-02 01:11

Looks cool, thanks! So when you say automatically is there a way to have it monitor a folder and just leave it open, and itl correct the album and move it? I currently do this by hand which can be frusturating. Do you have any tips for not letting it split a Album to a few different versions of the same album? I seem to have this problem a lot. Ill try your plugin when I get home and post my results.


- dan1son - 2009-12-02 01:24

I've been using Picard for quite a while and your setup seems pretty nice. The only main difference for me is I don't bother with scanning of files. Instead I "Cluster" them into albums and have it "lookup" the album. This makes the process much faster (especially since my files are across a network) since it doesn't fingerprint each and every song. It then throws the song ID into the songs based on the album release it finds as a cluster, so that data is still there.

I've also always manually moved the albums into folders. I've never found a tagger/player/ripper/etc. that could get them quite the way I want them. I'll likely give your scripts a go and see how it goes since I want to add the year to the album names for faster folder lookups. I'll change a couple things since I prefer <Artist>/<Album> (<Disc>) (<Year>)/<Track Num> - <Song Title> (<Featuring>).<Ext>

I will say it's amazing having a well organized and properly tagged library for XBMC or anything else. I never have problems anymore (unless the app doesn't support albumartist for compilations, but I can't help that).


- SleepyP - 2009-12-02 04:25

@dan1son
seems like cluster and then scan is a faster way to go, thanks for the tip. I posted a feature request to the MusicBrainz forum Smile

Just to help anyone wondering WTF the code is, I broke up my rename strings here:

First of all, everything is wrapped in
Code:
$replace(SomeText,:,)

This searches everything in the "SomeText" spot for the colon character, and if its found, it is removed. This is because colons are illegal filename characters in Windows, and Picard replaces them with an _, which results in ugly filenames (IMO). So, long story short, this removes all colons from the filepath.

Next, to handle the case where you want to remove the leading "The " from artist names, we use the
Code:
$if(if, then, else)
statement. Exactly what it seems, if whatever you put in the "if" spot comes up true, then the whatever you put in the "then" spot will be used as text, and the "else" spot is used the rest of the time. For my purposes, I'm using this as my "if" value:
Code:
$eq($left(%albumartist%,4),The )
This takes the first 4 characters of the Album Artist tag, and checks to see if they are "The ". If they are, it returns true. For my "Then" and "Else" values I used %albumartistsort% and %albumartist%, respectively. %albumartistsort% is a special value only used in the MusicBrainz database, which for bands is structured like "Beatles, The" or "Perfect Circle, A". For individual people, its Lastname, Firstname. This may be useful to know if you prefer to use the Lastname, Firstname style for something. There is a thread on the MusicBrainz forum where various people posted their crazy scripts. It is entirely possible to script it so you auto-generate folders with the first letter of the band name first so like "Beatles, The" will be automatically placed inside a folder named simply "B".

Anyways, the expression
Code:
$left(%date%,4)
translates to the album's release year in 4-digit format, AKA the "Year" as most people use it. Again, if you want to get fancy you can format that other ways, or I guess make like an auto-folder for the 70s, 80s, 90s, etc.

The expression
Code:
$if(%discnumber%,-CD %discnumber%,)
will only write out the phrase "-CD 1" if the disc number is actually present, and if not it will simply not write anything.

Finally, the expression
Code:
$num(%tracknumber%,2)
is the Track Number, padded to two digits (so if its less than 10 it will be given a leading 0).

@weldon, about as good as you can do is point it at a folder and have it recursively scan that folder, I'm afraid. Maybe another feature request?


RE: Musicbrainz Picard Tagger: My Tips And Things - 888ewc888 - 2012-08-09 11:58

SleepyP thanks for the guidelines above. I have been hacking away at the file naming all morning and you really helped be make heads/tails of the coding.

Here's what I finally landed on:

$if($and($eq(%compilation%,1), $eq(%albumartist%,Various Artists)), $unset(albumartist) $unset(albumartistsort))
$replace($if(%compilation%,%album%$if($gt(%totaldiscs%,1), CD$num(%discnumber%,2),)$if(%date%, \($left(%date%,4)\))/%artist% - %title%,%albumartist%/%albumartist% - %album%$if($gt(%totaldiscs%,1), CD$num(%discnumber%,2),)$if(%date%, \($left(%date%,4)\))/%albumartist% - %title%),:,)


RE: Musicbrainz Picard Tagger: My Tips And Things - Ayala - 2013-09-02 06:56

(2009-12-01 22:35)SleepyP Wrote:  I still use some other tools to handle my album art, lyrics tags, and random tag cleanup.

what tools do you use for album art, I'm pretty anal about how my covers look and i've got an entire collection of lossless files (FLAC & APE mostly) that i've tagged using Picard but I cannot manually add cover art to these.

what do you use? i'm on a mac btw!


RE: Musicbrainz Picard Tagger: My Tips And Things - dhead - 2013-09-02 08:17

I recommend on contributing to MusicBrainz album art collection, that's what I'm doing where in need.
If you upload to MusicBrainz then the recent version of Picard has no problem to immediately grab the image and embed it in the music files (and as folder.jpg).

For a popular album usually a suitable image already exist in another release so you don't have to look far.


RE: Musicbrainz Picard Tagger: My Tips And Things - Ayala - 2013-09-02 19:18

(2013-09-02 08:17)dhead Wrote:  I recommend on contributing to MusicBrainz album art collection, that's what I'm doing where in need.
If you upload to MusicBrainz then the recent version of Picard has no problem to immediately grab the image and embed it in the music files (and as folder.jpg).

For a popular album usually a suitable image already exist in another release so you don't have to look far.

I thought about that approach but its simply too time consuming i would have to identify which release matches the one I have, update it on music brainz and rescan my library for the update.

I wouldn't be opposed to submitting a large archive with clean high res cover art of what I have in my collection but I just want to alter my files locally atm.


RE: Musicbrainz Picard Tagger: My Tips And Things - sonusinghal - 2014-01-14 13:47

(2009-12-01 22:35)SleepyP Wrote:  Plugins
I wrote a new plugin for Picard because I hate the way "Featured Artists" are handled in MusicBrainz. My plugin searches the track titles for the phrase "Feat. " and if its found, it wraps that stuff up in parentheses and replaces "Feat. " with "Featuring ". I also tweaked the Disc # plugin to be case insensitive, since some releases in MusicBrainz are tagged as "Disc" and some "disc". In addition to these tweaks, I also use the Title Case plugin to capitalize the words the way I like them.

Note: I still use some other tools to handle my album art, lyrics tags, and random tag cleanup. However, Picard is pretty damned good.
Links:
-Tweaked Disc # Plugin
-My Featured Artist 2 Plugin
-Picard Tagger

Does anyone else use Picard? Input? Questions? Smile

can you please tell which all tools you use for album art and lyrics.
also the plugins cant be downloaded
Thanks


RE: Musicbrainz Picard Tagger: My Tips And Things - sleahcim - 2014-01-18 21:44

(2009-12-02 04:25)SleepyP Wrote:  The expression
Code:
$if(%discnumber%,-CD %discnumber%,)
will only write out the phrase "-CD 1" if the disc number is actually present, and if not it will simply not write anything.

It looks like this is adding "CD 1" behind every single album. Am I missing something?


RE: Musicbrainz Picard Tagger: My Tips And Things - ZelongOne - 2014-01-24 02:38

Hi There to Ya all,

I've been messing around with some scripts, but I got stuck all the time, so my question is can somebody help me?
What I want is very simple I think, this is how the output should be:

E:\Data\Music\<artist name>\<year> - <album>\<tracknumber> - <track title>

Yes it would be nice if it looked something like this:

$if($and($eq(%compilation%,1), $eq(%albumartist%,Various Artists)), $unset(albumartist) $unset(albumartistsort))
$replace($if(%compilation%,%album%$if($gt(%totaldiscs%,1), CD$num(%discnumber%,2),)$if(%date%, \($left(%date%,4)\))/%artist% - %title%,%albumartist%/%albumartist% - %album%$if($gt(%totaldiscs%,1), CD$num(%discnumber%,2),)$if(%date%, \($left(%date%,4)\))/%albumartist% - %title%),:,)

But then with the output as in my example

please help,................I'm really stuck Sad