[MusicBee] [ver. 2 available!] taggerscript for standardizing artists and setting display artist

howdy~

I’ve just written up a quick script for compatibility with MusicBee, and wanted to share it~ it requires @rdswift’s Additional Artist Variables (available from Picard’s plugin list or on GitHub)

$set(display artist,%artist%)
$setmulti(artist,%_artists_track_all_std_multi%)

this script differs from @psychoadept’s script (posted here), because it will standardize the artist names. that way it will also keep artists who aren’t consistent with their name, such as ~Avery~ or The O.C. Supertones’ tracks under the same artist, while preserving how they are displayed.

it also handles featured artists without relying on standardizing featuring/feat./ft., and other non-standard join phrases like “with”, “prod.”, and “(CV:”. it doesn’t split joined artists too, like Daryl Hall & John Oates and Lester Flatt & Earl Scruggs

it does not do anything with MusicBee’s guest artist tag, but I might try and figure that out at some point? I’m also wondering if there’s any possible way to determine if an artist has a semicolon in their name, such as lia;quo, and change the semicolon to something that won’t split an artist’s name in two…


let me know if you have any feedback or run into any bugs, as this is not thoroughly tested yet~

3 Likes

Instead of $setmulti use $copy like this:

$copy(artist,_artists_track_all_std_multi)

See also $copy — MusicBrainz Picard v2.10 documentation

4 Likes

actually, I may have spoken too soon, as it seems to have worked properly anyways.

I’d previously had a hard time fixing that artist in MusicBee, ended up using a Greek question mark “;” U+037E, which is typographically identical

…but it did seem to work properly with a regular semicolon upon a re-tagging. might do some testing later this week, see how $copy works differently (or better?). I’m using FLAC, so it might not work as expected with MP3 and ID3 tags as the script is right now…

after a bit of testing (and a big help from @rdswift, thank you~), I bring you version 2 of my MusicBee artist handler~

edit: updated to version 2.1, adding support for ‘/w’ as a join phrase

$noop(=======================================================================

MusicBee artist handler
[version 2.1]
written by rdswift and heavily modified by UltimateRiff

This script splits the track artists into main artists and guest artists
based on whether the artist appears before or after a join phrase containing
'feat', 'ft', 'with', '/w', or 'prod'.  It creates the following new tags based
on the artist names as standardized

  display artist: a built-in MusicBee tag, set as the original artist tag
    given {could have been modified by other Picard scripts or plugins}
  guest artist: another MusicBee tag which denotes secondary {or 'Guest'
    artists

it also modifies the %artist% tag to be a standardized multi-value tag, as
Musicbee will expect it to be

=============================================================================)
$set(display artist,%_artists_track_all_cred%)
$noop( change the above to %_artists_track_all_std% if you want the standardized names in display artist )

$noop( everything below was made with much help from @rdswift on the forums, thank you again for your help~ )
$set(_idx,)
$noop( you can add more join phrases by adding ',$in(%_test_phrase%,[desired phrase here])' before the '$set(_idx,)' argument )
$foreach(%_artists_track_all_join_phrases%,$set(_test_phrase,$lower(%_loop_value%))$if($or($in(%_test_phrase%,feat),$in(%_test_phrase%,ft),$in(%_test_phrase%,with),$in(%_test_phrase%,w/),$in(%_test_phrase%,prod)),$set(_idx,$if2(%_idx%,%_loop_count%))))
$if(%_idx%,
  $noop( "feat" found in join phrases )
  $noop( Set main and guest artists multi-values )
    $setmulti(artist,$slice(%_artists_track_all_std_multi%,0,%_idx%))
    $setmulti(guest artist,$slice(%_artists_track_all_std_multi%,%_idx%)),
  $setmulti(artist,%_artists_track_all_std_multi%)
)

this version can handle splitting out featured artists with join phrases including ‘feat’, ‘featuring’, ‘ft’, ‘with’, and ‘prod’. these will be added to the Guest Artist tag, which MusicBee will recognize, and the artists before the above join phrases will be added to Artist as usual~

again, let me know if y’all have any issues with the script~ brb, about to retag my whole library again~

edit: this script appears to be compatible with the Feat. Artist in Titles plugin from my very limited testing, but I don’t typically use this plugin, so let me know if y’all have any issues with it~

3 Likes

soo, @Victini is having an issue I can’t seem to figure out… been trying to troubleshoot over on the Discord to no avail, perhaps one of the taggerscript wizards have an idea? @rdswift @outsidecontext :mage:

we’re both on the same version of AAV (v0.8.2), Picard (v2.9), and the script (v2.1*), but I’m getting it to work perfectly (on Windows 11), and it does nothing over there (both on Linux and Windows 11). the checkbox for the script is ticked, so it doesn’t seem to be as simple as that…

there seem to be no scripts or plugins interfering with the functionality as far as we can tell

*this version just adds ‘/w’ to the list of join phrases it’s looking for, will update the script above momentarily


the releases we’ve been testing with are below:

Is @Victini loading the release from MusicBrainz, or are they just working with files in the clustering pane? If loading from MusicBrainz, does the log show anything?

EDIT: Also, if @Victini has the “View Script Variables” plugin installed, does it show the hidden variables from the script? That would be a good indicator as to whether or not the script was running. Also, they do have the “Additional Artists Variables” plugin installed, right? :wink:

1 Like

I just tried the script with a fresh config, and the script seems to do what it is supposed to do:

Is the “Additional Artist Variables” plugin maybe not enabled?

The rightmost button in the plugin configuration turns the plugin on and off. For the latest version of Picard see the documentation at Plugins Options — MusicBrainz Picard v2.10 documentation

In Picard 2.9 the icons look different but the behavior is the same, see Plugins Options — MusicBrainz Picard v2.9.2 documentation .

1 Like

Release is loading on MusicBrainz, and AAV is enabled… VIew Script Variables doesn’t show anything either. I’ll have a look at the logs but I couldn’t find anything obvious.

If I still can’t find anything obvious I’ll reset the config and see if it works on a clean config.

Edit: Actually, this might be related?

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/picard/album.py", line 409, in _finalize_loading_track
    run_track_metadata_processors(self, tm, track_node, self._release_node)
  File "/usr/lib/python3.11/site-packages/picard/metadata.py", line 683, in run_track_metadata_processors
    _track_metadata_processors.run(album_object, metadata, track, release)
  File "/usr/lib/python3.11/site-packages/picard/plugin.py", line 265, in run
    function(*args, **kwargs)
  File "/home/victini/.config/MusicBrainz/Picard/plugins/additional_artists_variables.zip/additional_artists_variables.py", line 230, in make_track_vars
    process_artists(album_id, track_metadata, album_metadata, 'track')
  File "/home/victini/.config/MusicBrainz/Picard/plugins/additional_artists_variables.zip/additional_artists_variables.py", line 122, in process_artists
    for item in sorted(sorted(artist_credit['artist'][tag_type], key=itemgetter('name')), key=itemgetter('count'), reverse=True):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'count'

This is on 0.8.2 of AAV.

Edit 2: I reset my config and now it works. Must’ve been a config issue. Apologies for the inconvenience!

2 Likes

That’s an odd error indeed, but good to hear that you got it to work.