Artist Variables Plugin

Artist Variables [Download]

Overview

This plugin provides specialized album and track variables for use in naming scripts. It combines the functionality of the “Album Artist Extension” and “RDS Naming Variables” plugins, although the variables are provided with different names. This will require changes to existing scripts when switching from the previous plugins.


What it Does

This plugin reads the album and track metadata provided to Picard and exposes the information in a number of additional variables for use in Picard scripts. The plugin has been designed such that the information is presented consistently regardless of whether or not the Use standardized artist names option is selected. This means that some of the information available through the standard Picard tags will be duplicated in the variables provided by this plugin.

NOTE: There are no additional calls to the MusicBrainz website api for additional information.

Album Variables

  • _PriAArtistID - The ID of the primary / first album artist listed
  • _PriAArtistStd - The primary / first album artist listed (standardized)
  • _PriAArtistCred - The primary / first album artist listed (as credited)
  • _PriAArtistSort - The primary / first album artist listed (sort name)
  • _AdditionalAArtistID - The IDs of all album artists listed except for the primary / first artist, separated by a semicolon and space
  • _AdditionalAArtistStd - All album artists listed (standardized) except for the primary / first artist, separated with strings provided from the release entry
  • _AdditionalAArtistCred - All album artists listed (as credited) except for the primary / first artist, separated with strings provided from the release entry
  • _FullAArtistStd - All album artists listed (standardized), separated with strings provided from the release entry
  • _FullAArtistCred - All album artists listed (as credited), separated with strings provided from the release entry
  • _FullAArtistSort - All album artists listed (sort names), separated with strings provided from the release entry
  • _FullAArtistPriSort - The primary / first album artist listed (sort name) followed by all additional album artists (standardized), separated with strings provided from the release entry
  • _AArtistCount - The number of artists listed as album artists

Track Variables

  • _PriTArtistID - The ID of the primary / first track artist listed
  • _PriTArtistStd - The primary / first track artist listed (standardized)
  • _PriTArtistCred - The primary / first track artist listed (as credited)
  • _PriTArtistSort - The primary / first track artist listed (sort name)
  • _AdditionalTArtistID - The IDs of all track artists listed except for the primary / first artist, separated by a semicolon and space
  • _AdditionalTArtistStd - All track artists listed (standardized) except for the primary / first artist, separated with strings provided from the track entry
  • _AdditionalTArtistCred - All track artists listed (as credited) except for the primary / first artist, separated with strings provided from the track entry
  • _FullTArtistStd - All track artists listed (standardized), separated with strings provided from the track entry
  • _FullTArtistCred - All track artists listed (as credited), separated with strings provided from the track entry
  • _FullTArtistSort - All track artists listed (sort names), separated with strings provided from the track entry
  • _FullTArtistPriSort - The primary / first track artist listed (sort name) followed by all additional track artists (standardized), separated with strings provided from the track entry
  • _TArtistCount - The number of artists listed as track artists

Examples

The following are some examples using actual information from MusicBrainz:

Example 1:

Using the single “Fairytale of New York” by Walk Off The Earth (credited as “Gianni and Sarah”), the additional artist variables created are:

  • _PriAArtistID = e2a5eaeb-7de7-4ffe-a519-e18e427a5060
  • _PriAArtistStd = Walk Off The Earth
  • _PriAArtistCred = Gianni and Sarah
  • _PriAArtistSort = Walk Off The Earth
  • _FullAArtistStd = Walk Off The Earth
  • _FullAArtistCred = Gianni and Sarah
  • _FullAArtistSort = Walk Off The Earth
  • _FullAArtistPriSort = Walk Off The Earth
  • _AArtistCount = 1
  • _PriTArtistID = e2a5eaeb-7de7-4ffe-a519-e18e427a5060
  • _PriTArtistStd = Walk Off The Earth
  • _PriTArtistCred = Gianni and Sarah
  • _PriTArtistSort = Walk Off The Earth
  • _FullTArtistStd = Walk Off The Earth
  • _FullTArtistCred = Gianni and Sarah
  • _FullTArtistSort = Walk Off The Earth
  • _FullTArtistPriSort = Walk Off The Earth
  • _TArtistCount = 1

Because there is only one artist associated with this single, the _AdditionalAArtistID, _AdditionalAArtistStd, _AdditionalAArtistCred, _AdditionalTArtistID, _AdditionalTArtistStd and _AdditionalTArtistCred variables are not created.

Example 2:

Using the single “Wrecking Ball” by Sarah Blackwood, Jenni Pleau & Emily Bones, the additional artist variables created are:

  • _PriAArtistID = af7e5ea9-bd58-4346-8f78-d672e9f297f7
  • _PriAArtistStd = Sarah Blackwood
  • _PriAArtistCred = Sarah Blackwood
  • _PriAArtistSort = Blackwood, Sarah
  • _AdditionalAArtistID = 07fa21a9-c253-4ed0-b711-d63f7965b723; 541d331c-f041-4895-b8f2-7db9e27dc5ab
  • _AdditionalAArtistStd = Jenni Pleau & Emily Bones
  • _AdditionalAArtistCred = Jenni Pleau & Emily Bones
  • _FullAArtistStd = Sarah Blackwood, Jenni Pleau & Emily Bones
  • _FullAArtistCred = Sarah Blackwood, Jenni Pleau & Emily Bones
  • _FullAArtistSort = Blackwood, Sarah, Pleau, Jenni & Bones, Emily
  • _FullAArtistPriSort = Blackwood, Sarah, Jenni Pleau & Emily Bones
  • _AArtistCount = 3
  • _PriTArtistID = af7e5ea9-bd58-4346-8f78-d672e9f297f7
  • _PriTArtistStd = Sarah Blackwood
  • _PriTArtistCred = Sarah Blackwood
  • _PriTArtistSort = Blackwood, Sarah
  • _AdditionalTArtistID = 07fa21a9-c253-4ed0-b711-d63f7965b723; 541d331c-f041-4895-b8f2-7db9e27dc5ab
  • _AdditionalTArtistStd = Jenni Pleau & Emily Bones
  • _AdditionalTArtistCred = Jenni Pleau & Emily Bones
  • _FullTArtistStd = Sarah Blackwood, Jenni Pleau & Emily Bones
  • _FullTArtistCred = Sarah Blackwood, Jenni Pleau & Emily Bones
  • _FullTArtistSort = Blackwood, Sarah, Pleau, Jenni & Bones, Emily
  • _FullTArtistPriSort = Blackwood, Sarah, Jenni Pleau & Emily Bones
  • _TArtistCount = 3

Because there are multiple artists associated with both the album and the track, all artist variables are created.

Example 3:

Using the album “Kermit Unpigged” by The Muppets, the additional artist variables created for track 4, “All I Have to Do Is Dream” by Linda Ronstadt and Kermit the Frog, are:

  • _PriAArtistID = 2ca340a6-e8f2-489d-90c2-f37c5c802d49
  • _PriAArtistStd = The Muppets
  • _PriAArtistCred = The Muppets
  • _PriAArtistSort = Muppets, The
  • _FullAArtistStd = The Muppets
  • _FullAArtistCred = The Muppets
  • _FullAArtistSort = Muppets, The
  • _FullAArtistPriSort = Muppets, The
  • _AArtistCount = 1
  • _PriTArtistID = 498f2581-be21-4eef-8756-fbb89d79b1c0
  • _PriTArtistStd = Linda Ronstadt
  • _PriTArtistCred = Linda Ronstadt
  • _PriTArtistSort = Ronstadt, Linda
  • _AdditionalTArtistID = 992a7ea8-96c1-4058-ba96-f811c8d01c77
  • _AdditionalTArtistStd = Kermit the Frog
  • _AdditionalTArtistCred = Kermit the Frog
  • _FullTArtistStd = Linda Ronstadt and Kermit the Frog
  • _FullTArtistCred = Linda Ronstadt and Kermit the Frog
  • _FullTArtistSort = Ronstadt, Linda and Kermit the Frog
  • _FullTArtistPriSort = Ronstadt, Linda and Kermit the Frog
  • _TArtistCount = 2

Because there is only one artist associated with the album the _AdditionalAArtistID, _AdditionalAArtistStd and _AdditionalAArtistCred variables are not created.


EDIT: If there’s any interest in this, please let me know and I’ll submit it to the “official” Picard Plugins repository. Also, I’d really like to know if you encounter any problems with the plugin. Thanks.

9 Likes
  1. Is there really a need for this? Could you explain how you think that this data might be used?

  2. Is there a reason to create a new plugin rather than extending the existing albumartistextension plugin in a backwardly compatible way?

  1. I use it to meet the specific needs of my file naming scripts. I file releases in directories by the standardized name of the primary album artist and place any additional track artists (as credited) in the track filenames. I also check if the primary track artist (as credited) differs from the standardized primary album artist, and if so I include the credited name in the track filename.

  2. I could put the additional functionality in the existing albumartistextension plugin, but since it is exposing information about track artists as well the name would be misleading / incorrect. I could put the track functionality in a new separate plugin, but that would end up essentially duplicating most of the code, which I didn’t think would be efficient. I could make the new “Artist Variables” plugin backward compatible with the existing “Album Artist Extension” plugin, so that it could be used as a drop-in replacement and not require any changes to existing scripts.

NOTE: Based on this, I have canceled the PR to include this plugin in the “official” list of Picard plugins until there is some sort of consensus as to a path forward. It will remain available at the download link shown above.

1 Like

I’m going to run it against some of my albums to see what it does with albums I know, because I’m intrigued. I’m guessing I’m not the target demographic because I use a database-based media manager, and have little need for complex naming schemes.

I’m wondering about how this would fit with the Performer tags? At first glance it looks like it’s just replacing “Performer” with “Track artists,” and stripping out the instrument?

It’s actually not touching the “Performer” tags at all, nor any of the recording relationships. Mostly what it’s doing is exposing additional information about the Album Artist(s) and Track Artist(s) in the form of new variables. The only thing that’s different is that it’s also placing the primary (first) artist in a separate variable, and the additional (remaining) artists in another variable if there is more than one artist. This is done for both the Album Artists and Track Artists, and then provides a couple of choices for sort order. I tried to capture what’s happening in the examples provided.

Good job. I can confirm that it appears to work as intended.

1 Like

Hi @rdswift,

There are some annoying albums in my collection that blatantly have contributing artists but clearly a decision was made not to give them credit on any of the album releases. Two examples spring to mind:
The Chronic by Dr. Dre https://musicbrainz.org/release/51088001-d00c-384f-a266-315fd3ee797a
Blues Brothers the Definitive Collection https://musicbrainz.org/release/e7a577ef-269f-4feb-8154-45d062307572

The Chronic is packed full of artists that are declared “additional vocals” but dont make it as Artists per se.
Blues Brothers the Definitive Collection contains two tracks of interest: 1/4 “Think” in which Aretha Franklin is lead vocalist appearing only as “vocals” and 2/1 “Shake a Tail Feather” in which Ray Charles is the lead vocalist and tagged as “lead vocalist” but neither make it as an artist.
Both of these tracks’ artists are only Blues Brothers.

So my question is… can your plugin be used to extract these type of non-credited artists and insert them as appended values in “Artists”

Best Regards

I don’t think so, because the plugin only works with values already stored in the album and track artists metadata. The performer metadata is stored separately.

1 Like

I have a request:

Could this plugin be extended with some variables for instruments and vocals?

So you would have a variable that lists all instruments on a recording, a variable that lists all vocals on a recording. (e.g. Lead vocals, Alto vocals, Background vocals, etc.)

The Classical Extras plugin has something like that:

What would be very interesting and useful to have also is the ‘credited’ part that you see in the screenshot.
For example, the Korg MS20 is not an ‘allowed instrument’ by MusicBrainz’ instruments database.

So an editor can not enter that as an instrument, but he can add it as an attribute to (the allowed) ‘synthesizer’.
But Picard will not retrieve that information, and so you will only see ‘synthesizer’.
It looks like this ‘credited instruments’ will allow to retrieve and use that too.

1 Like

Just noting that Picard itself will also show the instrument as attributed if you disable Use standardized instrument and vocal credits.

That’s a good observation, and good to mention indeed.
But then (for the example given) I would get this:

And I prefer standardised like this:

So I was thinking that such an added variable would make it possible to get the best of both worlds.

There are some annoying albums in my collection that blatantly have contributing artists but clearly a decision was made not to give them credit on any of the album releases. Two examples spring to mind:
The Chronic by Dr. Dre https://musicbrainz.org/release/51088001-d00c-384f-a266-315fd3ee797a
Blues Brothers the Definitive Collection https://musicbrainz.org/release/e7a577ef-269f-4feb-8154-45d062307572

The Chronic is packed full of artists that are declared “additional vocals” but dont make it as Artists per se.
Blues Brothers the Definitive Collection contains two tracks of interest: 1/4 “Think” in which Aretha Franklin is lead vocalist appearing only as “vocals” and 2/1 “Shake a Tail Feather” in which Ray Charles is the lead vocalist and tagged as “lead vocalist” but neither make it as an artist.
Both of these tracks’ artists are only Blues Brothers.

So my question is… can your plugin be used to extract these type of non-credited artists and insert them as appended values in “Artists”

This is a question worthy of some consideration, though not as part of this plugin.

It is certainly possible to look for vocalist performers and check that they are included in the track artists - and if not add them in some fashion. It is potentially feasible that this could be done inside a tagging script, though a plugin might make it easier for those not technically knowledgeable about scripting.

The first question is how you would want these additional artists added to the track artist tag - to use the Blues Brothers examples, would you want “Blues Brothers (feat. Aretha Franklin)” or similar?

2 Likes

Can a multi-value field for the type of artist be added? (i.e., person vs. group vs. character). For example, this would enable a use case where characters are deleted from the artists multi-value field, leaving only the persons and/or groups when dealing with standard Japanaese character song artist credits.

Another multi-value field I’d like to see is the join phrases. (This would enable the reconstruction of the artist and/or artist sort fields.)

Yes. The information is already being downloaded by Picard so it was fairly easy to add to the Additional Artists Variables plugin.

Again, the information is already being downloaded by Picard so it was fairly easy to add to the Additional Artists Variables plugin.

I’ve created a pull request to add the following new multi-value variables:

  • _artists_album_all_types - All album artist types, as a multi-value
  • _artists_album_all_join_phrases - All album artist join phrases, as a multi-value
  • _artists_track_all_types - All track artist types, as a multi-value
  • _artists_track_all_join_phrases - All track artist join phrases, as a multi-value

If you want to try out the new version before it is “officially” released, you can download it from my repository on GitHub. As always, comments, suggestions and especially bug reports are always welcome.

4 Likes

_artists_track_all_types seems to work as I expect. ($copymerge not so much, since it removes duplicate values.)

Well, I did find 2 edge cases @rdswift :

  1. If the artist type is not known, the artist types multi-value field ends up smaller than the %musicbrainz_artistid% and %artists% multi-value fields. It will probably make sense to either put “null” or “unknown” in there instead.
  2. Similarly, if any artist credit join phrase is empty, then the join phrases field ends up smaller than the artists fields for which this is intended to be a parallel array with. Not sure there’s a good way to solve this one. Maybe a hardcoded string “[blank]”? (Or something else that seems unlikely to be a real join phrase.)
2 Likes

Good catch! That’s an oddity in the way Picard handles empty strings in processing multi-value variables. I can put in a default value such as ‘[blank]’ for the join phrase as you suggested and ‘unknown’ for the type as a work-around, but I’m also going to have a look at the code in Picard to see if it can be made to not drop empty elements.

EDIT: The PR has been updated to add the default work-around values, and the updated version is available from my repository (linked above).

1 Like

Hi Bob,
I saw the plugins update (ver 0.9) but I think there is something that no longer works correctly.
Check out this release

the previous version correctly reported the 2 IDs of the artists connected to the recording

but now the two artist variables extract the same id

even the sort fields seem to have something strange (see the underlined ones).

Now, look at this release too

previously there were 2 artists counted and the artist IDs were filled in correctly with the 2 different IDs

now, the new version of the plugin counts only 1 artist extracting the same id for both the primary and additional ones

Are these bugs?

1 Like

Yup, there was a bug. I’ve submitted the updated version to the “official” plugins site. Until it has been accepted and published, it is available for download from my GitHub repo and can be installed manually. Thanks for bringing this to my attention, and sorry for taking so long to look into it.

1 Like

no problem and thanks for fixing it :wink: