Well here’s my current one, developed over the past 15 years or so:
$noop(<!-- MusicBrainz Picard Tagger script -->)
$noop(<!-- 2019-10-17 Version 0.11 by Moonbase -->)
$noop(<!-- You should have plugin lastfmng enabled and set up -->)
$noop(<!-- This script also works with Picard 2.x/lastfmng 2.x -->)
$noop(<!-- Remove "Various Artists" on compilations – good for Logitech Mediaserver/SqueezeCenter -->)
$noop(<!-- We use the MB albumartistid for identification because there IS an artist called "Various Artists" -Torsten Pröfrock- -->)
$if($and($eq(%compilation%,1),$eq(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377)),$unset(albumartist) $unset(albumartistsort))
$noop(<!-- Set Original Year and Decade to date of first known release -- instead of using the date of THIS release -->)
$noop(<!-- Picard/Mutagen will automatically store originalyear as ID3v2.3 TORY [YYYY] or ID3v2.4 TDOR [YYYY-MM-DD], -->)
$noop(<!-- depending on which ID3v2 version is used. Additionally, a TXXX:originalyear tag gets saved for ID3v2, -->)
$noop(<!-- respectively ORIGINALYEAR for OGG and FLAC files. -->)
$noop(<!-- Plugin lastfmng sets originaldate to the first known track release year from last.fm -->)
$if(%originaldate%,$set(originalyear,$left(%originaldate%,4)))
$noop(<!-- It may happen that we have NO originaldate from the plugin but originalyear from Picard, so base Decade on that -->)
$if(%originalyear%,$set(comment:Songs-DB_Custom1,$left(%originalyear%,3)0s))
$noop(<!-- Fallback: If we have originalyear BUT NOT originaldate, put the originalyear back into originaldate -->)
$if($and(%originalyear%,$not(%originaldate%)),$set(originaldate,%originalyear%))
$noop(<!-- For a single track, if we couldn't find a grouping and/or genre, set it to the album's grouping and genre -->)
$if(%grouping%,,$setmulti(grouping,%albumgrouping%))
$if(%genre%,,$setmulti(genre,%albumgenre%))
$noop(<!-- Plugin lastfmng sets some album-related tags: we do not want these -->)
$unset(albumgenre)
$unset(albumgrouping)
$unset(albummood)
$unset(comment:Songs-DB_Occasion_album)
$unset(comment:Songs-DB_Custom1_album)
$unset(comment:Songs-DB_Custom2_album)
$unset(comment:Songs-DB_Custom3_album)
$unset(comment:Songs-DB_Custom4_album)
$noop(<!-- As workaround for ID3v2.3, store MOOD in TXXX:Mood, since we have no TMOO tag as in ID3v2.4 -->)
$if(%mood%,$set(~id3:TXXX:Mood,%mood%))
$noop(<!-- As workaround for ID3v2.3, store DISCSUBTITLE in TXXX:discsubtitle, since we have no TSST tag as in ID3v2.4 -->)
$if(%discsubtitle%,$set(~id3:TXXX:discsubtitle,%discsubtitle%))
$noop(<!-- Ambiguous album names: store MusicBrainz' _releasegroupcomment and use in file naming later on -->)
$if(%_releasegroupcomment%,$set(releasegroupcomment,%_releasegroupcomment%))
$noop(<!-- Ambiguous track names: store MusicBrainz' _recordingcomment and use in file naming later on -->)
$if(%_recordingcomment%,$set(recordingcomment,%_recordingcomment%))
File naming to go with it:
$if($and($eq(%compilation%,1),$or($eq(%albumartist%,),$eq(%musicbrainz_albumartistid%,89ad4ac3-39f7-470e-963a-56509c546377))),$if2(%artistsort%,%artist%)/$if2(%artistsort%,%artist%) - [compilations]/$if2(%artistsort%,%artist%) - %title%$if(%recordingcomment%, \(%recordingcomment%\)),$if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%)/$if(%album%,$if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%) - %album%$if(%releasegroupcomment%, \(%releasegroupcomment%\))$if(%date%%_primaryreleasetype%%_secondaryreleasetype%%releasecountry%, \()$if(%date%,$left(%date%,4))$if($and(%date%,%_primaryreleasetype%), )$if(%_primaryreleasetype%,%_primaryreleasetype%)$if($and(%date%%_primaryreleasetype%,%_secondaryreleasetype%),\, )$if(%_secondaryreleasetype%,%_secondaryreleasetype%)$if($and(%date%%_primaryreleasetype%%_secondaryreleasetype%,%releasecountry%),\, )$if(%releasecountry%,%releasecountry%)$if(%date%%_primaryreleasetype%%_secondaryreleasetype%%releasecountry%,\))/$if(%discsubtitle%,$if(%media%,%media% ,)$if(%discnumber%,%discnumber%: ,)%discsubtitle%/,),)$if2(%artistsort%,%artist%) - %title%$if(%recordingcomment%, \(%recordingcomment%\)))
I use fdemmer’s lastfmng plugin to get genres and some other stuff, so for completeness’ sake here is the plugin’s config.ini
I use:
[global]
soundtrack_is_no_genre = True
ignore_feat_artists = False
; string used as fallback, when no tag value could be determined
default_unknown =
; this disables both album and track stats if set to False
print_tag_stats = True
print_tag_stats_album = True
print_tag_stats_track = False
; only enable collect_unused if you have sqlite (windows and macos may not)
collect_unused = False
lastfm_host = ws.audioscrobbler.com
lastfm_port = 443
; author's last.fm api key -- please use your own!
lastfm_key = REDACTED
[category-defaults]
; do/don't collect tags for that category
enabled = True
; a hard limit for how many tags are assigned to the metatag
limit = 5
; name of another category, unused tags in this category will be used in the given one.
overflow =
; add all tags from the other category to this one
prepend =
; used to join tags if >1 are to be used (None to use multtag)
separator =
; alphabetically sort tags before joining to string
sort = False
; percentage; only the tags with a score above x% of the most popular are used
threshold = 0.5
; apply titlecase() function to each tag
titlecase = True
[category-grouping]
# grouping is used as major/high level category
limit = 1
separator =
overflow = genre
metatag_track = grouping
metatag_album = albumgrouping
[category-genre]
limit = 5
threshold = 0.4
prepend = grouping
metatag_track = genre
metatag_album = albumgenre
[category-mood]
# eg. angry, cheerful, clam, ...
limit = 5
metatag_track = mood
metatag_album = albummood
[category-occasion]
# eg. background, late night, party
limit = 5
metatag_track = comment:Songs-DB_Occasion
metatag_album = comment:Songs-DB_Occasion_album
[category-category]
# i don't really know
limit = 5
metatag_track = comment:Songs-DB_Custom2
metatag_album = comment:Songs-DB_Custom2_album
[category-country]
# country names
limit = 2
threshold = 0.7
metatag_track = comment:Songs-DB_Custom4
metatag_album = comment:Songs-DB_Custom4_album
[category-city]
# city names
limit = 1
threshold = 0.7
metatag_track = comment:Songs-DB_Custom3
metatag_album = comment:Songs-DB_Custom3_album
[category-decade]
# musical era, eg. 80s, 90s, ...
limit = 1
threshold = 0.7
titlecase = False
metatag_track = comment:Songs-DB_Custom1
metatag_album = comment:Songs-DB_Custom1_album
regexp = ^([1-9][0-9])*[0-9]0s$
[category-year]
# the full year, eg. 1995, 2000, ...
# not recommended: let musicbrainz provide that
enabled = False
limit = 1
threshold = 0.7
titlecase = False
metatag_track = year
regexp = ^[1-9][0-9]{3}$
[searchlist]
;;; loosely based on the "standard" id3v1 genres
;;; #TODO i am not very happy with this. maybe the contemporary genres
;;; list in wikipedia would be better as a basis for grouping.
grouping = Blues, Classic Rock, Country, Dance, Disco, Funk,
Grunge, Hip-Hop, Jazz, Metal, New Age, Oldies, Pop,
R&B, Rap, Reggae, Rock, Techno, Industrial, Alternative,
Ska, Death Metal, Pranks, Soundtrack, Euro-Techno, Ambient,
Trip-Hop, Vocal, Jazz+Funk, Fusion, Trance, Classical,
Acid, House, Game, Sound Clip, Gospel, Noise,
Alternative Rock, Bass, Soul, Punk, Space, Meditative,
Instrumental Pop, Instrumental Rock, Ethnic, Gothic, Darkwave,
Techno-Industrial, Electronic, Pop-Folk, Eurodance, Dream,
Southern Rock, Comedy, Cult, Gangsta,
Pop/Funk, Jungle, Native US, Cabaret, New Wave, Psychadelic,
Rave, Showtunes, Trailer, Lo-Fi, Tribal, Acid Punk, Acid Jazz,
Polka, Retro, Musical, Rock & Roll, Hard Rock, Folk,
Folk-Rock, National Folk, Swing, Fast Fusion, Bebob, Latin,
Revival, Celtic, Bluegrass, Avantgarde, Gothic Rock,
Progressive Rock, Psychedelic Rock, Symphonic Rock, Slow Rock,
Big Band, Chorus, Easy Listening, Acoustic, Humour, Speech,
Chanson, Opera, Chamber Music, Sonata, Symphony, Booty Bass,
Primus, Porn Groove, Satire, Slow Jam, Club, Tango, Samba,
Folklore, Ballad, Power Ballad, Rhytmic Soul, Freestyle, Duet,
Punk Rock, Drum Solo, Acapella, Euro-House, Dance Hall, Goa,
Drum & Bass, Club-House, Hardcore, Terror, Indie,
Polsk Punk, Beat, Heavy Metal,
Black Metal, Crossover,
Merengue, Salsa, Trash Metal, Anime, Synthpop
;;; genre should not also contain tags from grouping or you'll get duplicates!
genre = soundtrack, score, Instrumental, hair metal,
2 tone, a cappella, abstract hip-hop, acid, acid jazz,
acid rock, acid house, acoustic guitar, acoustic rock, adult alternative,
adult contemporary, alternative country, alternative folk,
alternative metal, alternative pop, alternative rock, anti-folk, aor, austropop, britpop,
art rock, atmospheric, aussie hip-hop, avant-garde, ballads, baroque, beach,
beats, bebop, big band, big beat, blaxploitation, blue-eyed soul, bluegrass, blues
rock, boogie rock, boogie woogie, bossa nova, breakbeat, breaks, brit pop,
brit rock, british invasion, broadway, bubblegum pop, cabaret, calypso, cha
cha, choral, christian rock, classic country, classical guitar, club,
college rock, composers, contemporary classical, contemporary country, contemporary folk, country
folk, country pop, country rock, crossover, dance pop, dancehall, dark
ambient, darkwave, delta blues, dirty south, disco, doo wop, doom metal,
downtempo, dream pop, drum and bass, dub, dub reggae, dubstep, ebm, east coast
rap, easy listening, edm, electric blues, electro, electro pop, elevator music,
emo, emocore, ethnic, eurodance, europop, experimental, fingerstyle, folk
jazz, folk pop, folk punk, folk rock, folksongs, free jazz, french rap,
funk metal, funk rock, fusion, g-funk, gaelic, gangsta rap, garage,
garage rock, glam rock, goa trance, gospel, gothic, gothic metal, gothic
rock, gregorian, groove, guitar, happy hardcore, hard rock,
hardcore, hardcore punk, hardcore rap, hardstyle, heavy metal, honky tonk,
horror punk, house, humour, hymn, idm, indie folk, indie pop, indie rock,
industrial, industrial metal, industrial rock, instrumental
hip-hop, instrumental rock, j-rock, jangle pop, jazz fusion, jazz
vocal, jungle, latin, latin jazz, latin pop, lounge, lovers rock, lullaby,
madchester, mambo, medieval, melodic rock, minimal, minimalism, modern country, modern
rock, mood music, motown, ndw, ndh, neo-soul, new age, new romantic, new wave, noise,
northern soul, nu-metal, oi, old school rap, opera, orchestral, philly soul,
piano, political reggae, polka, pop life, pop punk, pop rock, pop soul, post
punk, post rock, power pop, progressive, psychedelic,
psychedelic folk, psychedelic punk, psychedelic rock, psychobilly,
psytrance, quiet storm, r&b, ragga, rap, rap metal, reggae pop,
reggae rock, rnb, rock and roll, rock opera, rockabilly, rocksteady, roots, roots
reggae, rumba, salsa, samba, schlager, screamo, shanty, shock rock, ska punk,
smooth jazz, soft rock, southern rock, space rock, speech, spoken word, standards,
stoner rock, surf rock, swamp rock, swing, symphonic metal, symphonic rock,
synth pop, synthpop, tango, techno, teen pop, thrash metal, traditional country,
traditional folk, tribal, turntablism, underground, underground
hip-hop, underground rap, urban, vocal trance, waltz, west coast rap,
western swing, world, world fusion, power metal, alternative punk,
post punk, folktronica, glam, folk metal, viking metal, progressive metal,
downbeat, groovesalad, post grunge, christian, classic metal, melodic metal,
j-pop, j-rock, neoclassical, composer, symphonic, speed metal, post metal
mood = angry, bewildered, bouncy, calm, cheerful, chill, cold,
complacent, crazy, crushed, cynical, dark, dramatic, dreamy, drunk,
eclectic, emotional, energetic, envious, feel good, flirty, funky, groovy,
happy, haunting, healing, high, hopeful, hot, humorous, inspiring, intense,
irritated, laidback, lonely, lovesongs, meditation, melancholic, melancholy,
mellow, moody, morose, passionate, peace, peaceful, playful, pleased,
positive, quirky, reflective, rejected, relaxed, retro, sad, sentimental,
sexy, silly, smooth, soulful, spiritual, suicidal, surprised, sympathetic,
trippy, upbeat, uplifting, weird, wild, yearning, catchy, nostalgic,
heartbreaking, lovely, depressive, cool, slow, sweet, soft, fun, heavy,
cheap, fast
occasion = background, birthday, breakup, carnival, chillout,
christmas, death, dinner, drinking, driving, graduation, halloween, hanging
out, heartache, holiday, late night, love, new year, party, protest, rain,
rave, romantic, sleep, spring, summer, sunny, twilight, valentine, wake up,
wedding, winter, work, xmas
category = animal songs, amazing, awesome, attitude, autumn, b-side, ballad,
banjo, bass, beautiful, body parts, bootlegs, brass, cafe del mar, chamber
music, clarinet, classic, classic tunes, compilations, covers, cowbell,
deceased, demos, divas, dj, drugs, drums, duets, field recordings, female,
female vocalist, film score, flute, food, genius, girl group, great lyrics,
guitar solo, guitarist, handclaps, harmonica, historical, horns, hypnotic,
influential, insane, jam, keyboard, legends, life, linedance, live, loved,
lyricism, male, male vocalist, masterpiece, melodic, memories, musicals,
nostalgia, novelty, number songs, old school, oldie, oldies, one hit
wonders, orchestra, organ, parody, poetry, political, promos, radio
programs, rastafarian, remix, samples, satire, saxophone, showtunes,
sing-alongs, singer-songwriter, slide guitar, solo instrumentals,
speech, stories, strings, stylish, synth, top 40, traditional,
trumpet, unique, unplugged, violin, virtuoso, vocalization, vocals,
cover, epic, best of
;;; #TODO translate countries. eg. icelandic -> iceland
country = african, american, arabic, australian, austrian,
belgian, brazilian, british, canadian, caribbean, celtic, chinese, cuban,
danish, dutch, eastern europe, egyptian, estonian, european, finnish,
french, german, greek, hawaiian, ibiza, icelandic, indian, iranian, irish,
island, israeli, italian, jamaican, japanese, korean, mexican, middle
eastern, new zealand, norwegian, oriental, polish, portuguese, russian,
scandinavian, scottish, southern, spanish, swedish, swiss, thai, third
world, turkish, welsh, western, texas, uk, belgium, england, scotland,
usa, suomi, germany, austria, finland, icelandic
city = acapulco, adelaide, amsterdam, athens, atlanta,
atlantic city, auckland, austin, bakersfield, bali, baltimore, bangalore,
bangkok, barcelona, barrie, beijing, belfast, berlin, birmingham, bogota,
bombay, boston, brasilia, brisbane, bristol, brooklyn, brussels, bucharest,
budapest, buenos aires, buffalo, calcutta, calgary, california, cancun,
caracas, charlotte, chicago, cincinnati, cleveland, copenhagen, dallas,
delhi, denver, detroit, dublin, east coast, edmonton, frankfurt, geneva,
glasgow, grand rapids, guadalajara, halifax, hamburg, hamilton, helsinki,
hong kong, houston, illinois, indianapolis, istanbul, jacksonville, kansas
city, kiev, las vegas, leeds, lisbon, liverpool, london, los angeles,
louisville, madrid, manchester, manila, marseille, mazatlan, melbourne,
memphis, mexico city, miami, michigan, milan, minneapolis, minnesota,
mississippi, monterrey, montreal, munich, myrtle beach, nashville, new
jersey, new orleans, new york, new york city, niagara falls, omaha, orlando,
oslo, ottawa, palm springs, paris, pennsylvania, perth, philadelphia,
phoenix, phuket, pittsburgh, portland, puebla, raleigh, reno, richmond, rio
de janeiro, rome, sacramento, salt lake city, san antonio, san diego, san
francisco, san jose, santiago, sao paulo, seattle, seoul, shanghai,
sheffield, spokane, stockholm, sydney, taipei, tampa, tijuana, tokyo,
toledo, toronto, tucson, tulsa, vancouver, victoria, vienna, warsaw,
wellington, westcoast, windsor, winnipeg, zurich
; add words (in uppercase!) that should be kept uppercase by titlecase
abbreviations = USA, UK, EBM, EDM, IDM, NDW, NDH, R&B, AOR
[translations]
; <name1> is translated into <name2>
acoustic guitar = guitar
ambient piano = piano
brit pop = britpop
chill out = chillout
depressed = depressive
deutsch = german
dnb = drum and bass
drum 'n' bass = drum and bass
drum n bass = drum and bass
electronica = electronic
english = england
female vocalists = female vocalist
hip hop = hip-hop
hiphop = hip-hop
jpop = j-pop
jrock = j-rock
male vocalists = male vocalist
melancholic = melancholy
nu metal = nu-metal
post-grunge = post grunge
post-metal = post metal
post-punk = post punk
post-rock = post rock
prog rock = progressive rock
relax = relaxed
relaxing = relaxed
rock 'n' roll = rock & roll
rock and roll = rock & roll
rock n roll = rock & roll
rock'n'roll = rock & roll
rnb = r&b
sex = sexy
trip hop = trip-hop
minimalist = minimalism
modern classical = contemporary classical
soundtracks = soundtrack
speeches = speech
00s = 2000s
10s = 2010s
20s = 1920s
30s = 1930s
40s = 1940s
50s = 1950s
60s = 1960s
70s = 1970s
80s = 1980s
90s = 1990s
It will sort each and everything under the (album) artist sort names. Titles picked up from compilation samplers are stored in a special subfolder albumartistsort - [compilations]
. The script uses release group comments to differentiate between albums of the same name (Peter Gabriel, Weezer, Elis, …), adds a release year, album type and release country in parentheses and disambiguates tracks of the same name by their recording comments (adding things like (live, 1990-03_ Billboard The Venue, Melbourne, Australia)
to the track filename to avoid things like title (1).flac
, title (2).flac
.
(Disregard the sole
[compilations]
folder, that was accidentally generated with an older script version.)
The year shown in the album folder name is the release year, the country the release country, so I can distinguish releases with the same name.
Oh, and there are no track numbers because I’m interested in the title and not their storage location on a particular medium. There is also some intended redundancy (repeated artist names) because the album and track artists can be different.
This structure makes me happy when travelling: It’s much easier copying stuff together onto a USB drive or SD card and still know which title is which. I was so fed up with USB sticks containing a hundred entries starting with 01. …
and no artist name …