I use the %grouping% tag to index tracks by a top-level genre (I used genres from rateyourmusic.com), which I define by specifying them in my genre script as in the example below. Most of the music playing devices I have owned have support for the grouping tag and I can also base my file tree and naming on this tag to further categorize the songs.
One nice thing about this method is that it inserts a singular genre string into the grouping tag, even if it fallbacks to using %genre% as the grouping. Another thing to note is that the grouping is added in the order you place the lines in the script.
So that when a tag matches multiple of your preset categories, it will set grouping as just the first genre that matches a word…
So for instance if I place the Rock script line before Pop as in the code below, then any song that has a genre tag that includes both of those (ie. Indie Pop, Indie Rock), will be given a grouping of the first. Which is Rock in this case.
Tinker with the genre settings to find the desired results.
I currently have set a maximum genre limit of 5 and a minimum genre usage of 60%
You can also use WikiData Genres to expand genre selection if so desired. It is hit or miss. Just remember to use the $copymerge portion as in my script so that you don’t get duplicates. If you encounter any undesired results when using wikidata genres then disable the wikidata plugin.
Sidenote: I have coded this in other ways for similar results, yet the grouping gets set to a multi-string tag when there is no matching top-level genre.
If anyone knows of a better method than setting the _topgenre to 0 at the beginning of the script, I’d be happy to know.
In the meantime, this is what works for me;
$setmulti(genre,$title(%genre%))
$copymerge(genre,genre)
$set(_topgenre,0)
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,EBM),Electronic,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Blues),Blues,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Gospel),Gospel,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Comedy),Comedy,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Metal),Metal,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Classical),Classical,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Country),Country,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Industrial),Industrial,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Electronic),Electronic,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Dance),Dance,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Punk),Punk,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Hip Hop),Hip Hop,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Ambient),Ambient,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Rock),Rock,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Pop),Pop,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Experimental),Experimental,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Field Recordings),Field Recordings,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Folk),Folk,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Jazz),Jazz,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Musical Theatre and Entertainment),Musical Theatre and Entertainment,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,New Age),New Age,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Psychedelia),Psychedelia,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,R&B),R&B,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Reggae),Reggae,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Regional),Regional,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Singer/Songwriter),Singer/Songwriter,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Ska),Ska,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Sounds and Effects),Sounds and Effects,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$if($rsearch(%genre%,Spoken Word),Spoken Word,0)))
$if($inmulti(%_topgenre%,0), $set(_topgenre,$slice(%genre%,,1,;)))
$setmulti(grouping,%_topgenre%)