Streamlining messy genre tags with a list of pre-defined genres

Hi, I’ve been automatically tagging music for a long time now. I’m tired of all the random genre tags though, so I have created a list of genres I listen to, and I want to keep just these genres in the tags, and delete the rest. It doesn’t have to be perfect, as I just want to use it on my current library, and from then on I’m going to manually tag all my new music. The reason why I can’t just automatically retag everything with e.g. the MusicBrainz database, or any others, because none fit my genre list the way I want them to.

Here in an example what I mean:
Song A has the following genre tags right now: Folk; Indie Rock; Chamber Folk; Melancholy; Rock; Singer-Songwriter; Contemporary Folk; Personal–Loved; Avant-Folk; 2018; Dark Folk; Indie; Beautiful; Piece Of Art; Indie Folk; Jazz Folk; Best Of 2018; 2018 Gem; Fip; Alternative Rock; Best Songs Of 2018; Female Vocalists; Underrated; Music For A Sad Road Movie; Acoustic; 2018 Releases; Alternative; Progressive Folk

I want to remove all genre tags that are not highlighted (in italics or bold) and retain only the highlighted ones from my list. These highlighted genres are part of a genre list I have created. Additionally, I’d like to create a grouping tag to categorize broader genres like Pop, Folk, Jazz, etc., while keeping more specific subgenres like Ambient Pop, Chamber Folk, Modal Jazz, etc., within the “genre” tag. So, while I don’t want to delete the bolded genres, I want to move them to a second category.

So, for song A, the end result would be:

Grouping: Folk; Rock
Genre: Indie Rock; Chamber Folk; Singer-Songwriter; Contemporary Folk; Indie Folk; Avant-Folk; Alternative Rock; Progressive Folk

This would be much, much easier to manage than the mess above. However, I can’t seem to figure out how I could do this. I have looked through so many options and plugins and while that seems like the option to use, none of the plugins seem to do it. I have also tried the last fm ng plugin, and replaced my genres and grouping with my own, but since then I can’t load the plugin. Not even if I completely wipe the plugins folder and reinstall it with the original ini file. That seemed like pretty much the way to do it.

Thank you so much in advance for any help for this.

1 Like

Some time ago I created a plugin called Genre Mapper which might help.


Please search and read the detail I have written about Genres in other threads, but in essence there are various issues with genres:

  1. MB genres are essentially tags which makes them unconstrained.
  2. MB genres (tags) are not voted on - so there are no quality checks and verifications. (There is no evidence of malicious changes to MB genres, but clearly without any quality checks they could be subject to malicious edits.)
  3. There is a list of MB established genres, but there aren’t editing guidelines for what they mean and how to use them.
  4. Genres need to be hierarchical - and perhaps have many to many parenthood. So Baroque is probably considered a sub-category of Classical, whilst Jazz Rock is a sub-category of both Jazz and Rock. Also, you have to decide whether use of a genre implies the parents or not and whether parent genres are added automatically.
  5. And finally we get to Picard which needs functionality to look up genres from more sources than just MB and to combine and filter etc. - functionality which is non-trivial.

There used to be a LastFM+ plugin which did a reasonable job of making sense of the LastFM genre chaos, so that might be a starting point for a more general Genre plugin.

When using genres from MusicBrainz with standard Picard options you could use the genre filter in Options > Metadata > Genres. Set the filter in the “Genres or folksonomy tags to include or exclude” to something like this:

+indie rock
+chamber folk
+contemporary folk
+indie folk
+alternative rock
+progressive folk

That would exclude all genres except the listed ones from being loaded from MusicBrainz.

It won’t help with the case of reorganizing existing tags, though, and also not with separating the tags into grouping.

Maybe Picard scripting could be used. If you add a script to Options > Scripts you can run this script also manually on any loaded file or track via the context menu. Maybe try adding a script like this:


$noop(Set selected genres as grouping)
$if($inmulti(%_all_genres%,Folk),$setmulti(grouping,%grouping%; Folk))
$if($inmulti(%_all_genres%,Rock),$setmulti(grouping,%grouping%; Rock))

$noop(Only keep selected genres in the genre tag)
$if($inmulti(%_all_genres%,Indie Rock),$setmulti(genre,%genre%; Indie Rock))
$if($inmulti(%_all_genres%,Chamber Folk),$setmulti(genre,%genre%; Chamber Folk))
$if($inmulti(%_all_genres%,Singer-Songwriter),$setmulti(genre,%genre%; Singer-Songwriter))
$if($inmulti(%_all_genres%,Contemporary Folk),$setmulti(genre,%genre%; Contemporary Folk))
$if($inmulti(%_all_genres%,Avant-Folk),$setmulti(genre,%genre%; Avant-Folk))
$if($inmulti(%_all_genres%,Indie Folk),$setmulti(genre,%genre%; Indie Folk))
$if($inmulti(%_all_genres%,Alternative Rock),$setmulti(genre,%genre%; Alternative Rock))
$if($inmulti(%_all_genres%,Progressive Folk),$setmulti(genre,%genre%; Progressive Folk))

Then run this on your loaded files (select the files and choose your script in the context menu → plugins. The idea is that the existing genres get stored aside in a variable, then it checks for specific genres in this list and sets them as grouping, e.g. it detects “Folk” and sets this to grouping with:

$if($inmulti(%_all_genres%,Folk),$setmulti(grouping,%grouping%; Folk))

Same for the genre tag. Just add additional lines for the genres you want to handle. Everything not handled here gets lost.

It’s not really elegant, but I think it is what works with existing capabilities. Maybe @rdswift has some nice idea how to improve it :slight_smile:

Some notes:

  • Checking for genres is case sensitive. I used the spelling as you wrote it under the assumption that is exactly how the genres are in your files.
  • Only first run this gives the proper resut, as afterwards the genre tag is already cleared. It should be safe to run the script again, but it will not change the result anymore.

I have not fully tested this, so let me know how it works.