Multiple value artist tag to multiple value artistsort

Is there a way how I can do this:

ARTIST: John Lewis:Mick Jagger;Ringo Harrison

-->

ARTISTSORT: Lewis, John;Jagger, Mick;Harrison, Ringo

I have found (and used it) solution how to make this if I have only one artist in ARTIST tag, but how can I do it if there's more than one artist in that tag?

Action type: Format value
Field: ARTISTSORT
Format string: %artist%

Action type: Replace with regular expression
Field: ARTISTSORT
Regular expression: ([^;]+)\s([^;]+)
Replace matches with: $2, $1

Dano, thank you very much!

I’ve been working on a refined version of this that handles all the following artist/composer formats, in fields that are semi-colon separated:

  • Otis Redding → ReddingOtis
  • Booker T. Jones → JonesBookerT
  • Donald “Duck” Dunn → DunnDonaldDuck
  • Al Jackson, Jr. → JacksonJrAl
  • Ludvig van Beethoven → BeethovenLudvigvan

The algorithm is something like:

  • Copy the COMPOSER field to COMPOSERSORT
  • Handle suffixes identified with a comma seperator, plus any number of forenames
  • Handle all other names, with any number of forenames
  • Remove various characters from the sort field

I use the following actions in a group:

  • Format tag field “COMPOSERSORT”: %COMPOSER%
  • Replace with Regular Expression “COMPOSERSORT”: “(?:([^;]+)\s)+([^;]+),\s*([^;]+)” → “$2$3$1
  • Replace with Regular Expression “COMPOSERSORT”: “(?:([^;]+)\s)+([^;]+)” → “$2$1
  • Replace with Regular Expression “COMPOSERSORT”: “[". ]" → "”

This is one example of what it can do:

  • Composer: Al Jackson, Jr.;Booker T. Jones;Donald "Duck" Dunn;Junior Wells;Steve Cropper
  • ComposerSort: JacksonJrAl;JonesBookerT;DunnDonaldDuck;WellsJunior;CropperSteve

I shall continue to tune it as I hit any other combinations that break the algorithm.

Does it work with groups like "Earth, Wind & Fire"?

In any case: I am pretty sure that any sorting will not produce better results after the first transformed name. Or in other words: Unless there are a lot of varying persons who joined Al Jackson Jr, I doubt that the sorting result will be much better.
Also, I find that the list of persons ist not really sorted. Why would Mr. Wells (letter #22) come before Mr. Cropper (letter #3).

Should be: (IMHO)
CropperSteve;DunnDonaldDuck;JacksonJrAl;JonesBookerT;WellsJunior

It does not attempt to address the problem of distinguishing between the names of people (that should be sorted on last name) and the names of groups (that should not). I do this manually, ie. only apply the action to tracks that contain peoples’ names.

I agree about the usefulness of doing the sort field like this. I ought to do some testing to see if it makes any material difference in any interface I use (I’m using Lyrion with a Transporter and a WiiM Ultra).

As for sorting the list of persons, they are usually listed in order of significance, not alphabetical, so sorting them within the field would make no sense.

I like what you have done, nice work! As always, any specific use cases for Artists that should not be reorganized such as Earth, Wind & Fire should be handled separately. There are always exceptions.

Plus any library management should be able to separate these multi-value fields and list them correctly anyhow.