Listing all Artists from Album into One Tag Field

Hey Guys,

I've searched for a few hours now and can't seem to find any documentation on this.

When tagging my files, I typically will list all the artists on an album in the ALBUMARTISTSORT field, each separated with a semi-colon. I do this so that in Foobar, the enter album will be listed under each artist on the album.

I am wondering if there is a way to easily compile all the artists from the album into ALBUMARTISTSORT on every track? For example, take the album:

Simon & Garfunkel - Bridge Over Troubled Water

I would have the following tags for every track:

ALBUM ARTIST: Simon & Garfunkel
ALBUMARTISTSORT: Paul Simon; Art Garfunkel; Simon & Garfunkel

Is there a way to pull that data from each track, even if all the artists from the album aren't listed on each track?

Sorry if that was confusing, it's somewhat hard to explain.

Thanks for you help guys.

Why in the world would you want to do that? Then the artist 'Simon & Garfunkel' ends up sorted under 'P'? Makes no sense.

At first see there ...
... then come back and ask further questions.


The goal would be to have the release show up under Paul Simon, Art Garfunkel, and Simon & Garfunkel. This is extremely helpful for compilations where each artist only has one track on the release. Using this method, the whole release would show up when a certain artist is selected in Foobar.

I found that thread in my searches. The last thread pretty much sums up my question: is there a script to automate this action?

I think there are several obstacles to overcome. SOme are technical and others are of a semantical nature.
Technically does MP3tag not know anything about albums. It looks at one track at the time. So it cannot "remember" what it found in other tracks - unless you export the data, manipulate it there and then reimport that.

On the other hand: how do you get the information that SImon & Garfunkel consist of Paul SImon and Art Garfunkel? Is that stored somewhere in the fields? If so, you can add that info to ARTISTSORT.
If you have to add it manually anyway, then a short glance at all the tracks would get the data and enable you to hack it in...
I doubt that there is an action that create mulitvalue fields.

I sort of thought that it would be hard to do this with a script as it would require some sort of memory function to store all the artist values. Is there any way to reference the track right before or after? You could potentially 'build' the albumartistsort one track at a time, then have the desired tag on the last track of the album, from which it can be copied to the other tracks...?

What about some sort of export, as you suggested? Some how export the artists from each track into a text file, separating each with a semi colon, then importing the result into one tag field. Can this be done?

The Simon & Garfunkel example is a bad one. This has the most use for compilation releases where there are a number of artists on the release. Something where each track has a different artist. Normally if you select an artist in the music player, it will only show the tracks that they were the artist for on the release. With this tag that I am trying to do, the whole release would show, which for me is quite desirable.

1: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Report.CollectArtistsPerAlbum.txt',UTF-8)

2: $puts(Info,'This Mp3tag export script creates a report text file of format CSV (
comma separated values).
3: $puts(Info,'The CSV columns are: "Album","ArtistCollection","Filepath".')
4: $puts(Info,'The output list is sorted by "Album", then by "Filepath".')
5: $puts(Info,'The column "ArtistCollection" contains a list of artist names, which have been collected from
the files of the related Album.
6: $loop(%ALBUM%)$puts(ListOfArtists,)$loop(%ALBUM%)$puts(ListOfArtists,$get(ListOfArtists)%ARTIST%';')$loopend()
7: $loop(%ALBUM%)$loop(%_path%)'"'%ALBUM%'","'$trim($get(ListOfArtists),';')'","'%_path%'"'
8: $loopend()$loopend()$loopend()

You have to import the report output file into the selected files, ...
using the converter "Textfile -Tag" with a format string like ...

The import process complains about empty lines, which cannot be parsed, this can be ignored.

20130208.Export.CollectArtistsPerAlbum.1.mte (730 Bytes)


20130208.Export.CollectArtistsPerAlbum.1.mte (730 Bytes)

Yes, MP3tag can export the ARTIST to a text file.
And then?

I can think of only the following sequence: Open the text file, join all artists in one line, separated by a semicolon, and then either duplicate the line as many times as there are files or copy that line to the clipboard and then paste it directly into the ARTISTSORT field in MP3tag...
I do not see any better way.

And still no: Mp3tag does not remember any data from other files than the current one (except in the track number assisstant).

Here comes a modification of the export script from before.
While importing, the '\\' separated list of artist names will be automatically itemized and stored into a multi-value tag-field.

01: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Report.CSV.CollectArtistsPerAlbum.txt',UTF-8)

02: $puts(Info,'This Mp3tag export script creates a report text file of format CSV (
comma separated values).
03: $puts(Info,'The CSV columns are: "Album","ArtistCollection","Filepath".')
04: $puts(Info,'The CSV output list is sorted by "Album", then by "Filepath".')
05: $puts(Info,'The CSV column "ArtistCollection" contains a list of artist names, which have been collected from
the files of the related Album.
06: $puts(Info,'The artist names are separated by the delimiter sequence "\\", which supports the automatically creation of a multi-value tag-field, when importing the list of artist names into a tag-field.')
07: $puts(Info,'After importing the CSV data into the related files, each file contai
ns a multi-value tag-field, which can be freely named due to the import format string.
08: $loop(%ALBUM%)$puts(ListOfArtists,)$loop(%ALBUM%)$puts(ListOfArtists,$get(ListOfArtists)%ARTIST%'\\')$loopend()
09: $loop(%ALBUM%)$loop(%_path%)'"'%ALBUM%'","'$trim($get(ListOfArtists),'<!--colorc-->')'","'%_path%'"'
10: $loopend()$loopend()$loopend()

20130208.Export.CollectArtistsPerAlbum.2.mte (1.16 KB)


20130208.Export.CollectArtistsPerAlbum.2.mte (1.16 KB)

Here comes another modification of the export script from before.
The artist names are separated by the delimiter sequence "; " (semicolon+space).
The list of artist names contains unique artist names and is sorted by artist name.

01: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Report.CollectArtistsPerAlbum.txt',UTF-8)

02: $puts(Info,'This Mp3tag export script creates a report text file of format CSV (
comma separated values).
03: $puts(Info,'The CSV columns are: "Album","ArtistCollection","Filepath".')
04: $puts(Info,'The CSV output list is sorted by "Album", then by "Filepath".')
05: $puts(Info,'The CSV column "ArtistCollection" contains a list of artist names, which have been collected from
the files of the related Album.
06: $puts(Info,'The artist names are separated by the delimiter sequence "; " (semicolon+space).')
07: $puts(Info,'Duplicate artist names will be removed from the list of artist names.')
08: $puts(Info,'The list of artist names will be sorted by artist name.')$puts(Info,)
09: $loop(%ALBUM%)$puts(ListOfArtists,)$loop(%ARTIST%)$loop(%ALBUM%)$puts(ListOfArtists,$get(ListOfArtists)%ARTIST%'; ')$loopend()$loopend()
10: $loop(%ALBUM%)$puts(ListOfArtists,$trim($regexp($get(ListOfArtists),'(?:(?<=;)|(?<=\A)|(?<=^))\s?([^;]);(?=.?(?<=;)\s?\1(?=;|\Z|$))(?#remove dups from semicolon- or semicolon+space- delimited list)',),'; '))$loopend()
11: $loop(%ALBUM%)$loop(%_path%)'"'%ALBUM%'","'$get(ListOfArtists)'","'%_path%'"'
12: $loopend()$loopend()$loopend()

20130208.Export.CollectArtistsPerAlbum.3.mte (1.27 KB)


20130208.Export.CollectArtistsPerAlbum.3.mte (1.27 KB)

That's generally how you would use the ARITST field. The ARTISTSORT field is intended to be used as the string to sort the ALBUMARTIST under. Not many people would want 'Simon & Garfunkel' sort under 'P' (or 'A' if it happens to work out that way).

Awesome! I'll give this one a shot. Thanks for your help.


Wow, this script works so well! Thanks again my friend.

One question: it works best for compilations where there are single artists per track. Is there a way to slightly modify if so that if an entire album has an artist like "Simon & Garfunkel", it would output "Simon; Garfunkel; Simon & Garfunkel"? I would hope it would work with compilations where some of the tracks have multiple artists as well. For instance on the release listed below, the output would look something like "...; Pink; Fergie; Ludacris; Beyonce; Shakira; Beyonce and Shakira; ...". So it would find the word 'and' or the symbol '&' and create multiple items out of it. It would also find the word 'feat.' or 'featuring' and create multiple items out of it as well.

Thank you so much for your help DetlevD, I really appreciate it.

I wouldn't want the album to only be sorted under 'A', the goal would be for the album to show-up when Art Garfunkel is selected, as well as Paul Simon and Simon & Garfunkel. Normally, only the tracks that were done by Art Garfunkel from the album would show up under Art Garfunkel. I want the tracks that are done by Paul Simon alone to show up as well.

For instance, take the compilation NOW! 25 (sorry for the bad release, it's just for example). Here is the track listing:

No. Title Artist Length

  1. "Thnks fr th Mmrs" Fall Out Boy 3:22
  2. "Girlfriend" Avril Lavigne 3:35
  3. "The Sweet Escape" Gwen Stefani featuring Akon 4:05
  4. "U + Ur Hand" Pink 3:32
  5. "Glamorous" Fergie featuring Ludacris 4:06
  6. "Beautiful Liar" Beyoncé and Shakira 3:17
  7. "Summer Love" Justin Timberlake 4:09
  8. "Because of You" Ne-Yo 3:45
  9. "Buy U a Drank (Shawty Snappin')" T-Pain featuring Young Joc 3:48
  10. "Get It Shawty" Lloyd 3:28
  11. "Pop, Lock & Drop It" Huey 4:21
  12. "Like This" Mims 3:25
  13. "I Tried" Bone Thugs-n-Harmony featuring Akon 4:47
  14. "Outta My System" Bow Wow featuring T-Pain & Johntá Austin 3:52
  15. "Never Again" Kelly Clarkson 3:34
  16. "The Great Escape" Boys Like Girls 3:26
  17. "I Told You So" Keith Urban 3:58
  18. "Before He Cheats" Carrie Underwood 3:17
  19. "Wait for You" Elliott Yamin 3:58
  20. "Home" Daughtry 4:12

Normally, if you find 'Fall Out Boy' on your list of artists in your music player, under the 'NOW! 25' album, only their "Thnks fr th Mmrs" track would show up. I want all the above tracks to show up when 'Fall Out Boy' is selected (or any artist on the release). Having just 'Various Artists" in the ALBUMARTIST field would not solve this.

Such manipulations you mentioned should not carry out within the export script, it is better to do it with the Mp3tag actions.
You can perform all those manipulations on one or more auxiliary tag-fields, if needed.
You have to prepare the data ... for each special file ... in such a way, that the report script can work with the data in general.
You can change the export script to use an auxiliary tag-field instead of the original tag-field.

Converter: "Tag - Tag" ... or ... Action: "Format value"
Field: TEST
Format string: $regexp(%ARTIST%,'^(.+?)\s+&\s+(.+?)$','$1; $2; $0')
Simon & Garfunkel
Simon; Garfunkel; Simon & Garfunkel


Alright, that works. Two steps is FAR better than manually entering in everything.

Thanks again for your help.

Most people want exactly the opposite when they select a track artist from a compilation. They want to drill down and only see the track(s) on the album from that one artist. Which is why most programs work like that.

If using ALBUMARTISTSORT solves that for you, then it's an odd side effect of the software. What program do you use?

I have programed Foobar to display the albums like this. I hate to see single tracks from albums, it's quite annoying for me. This method works best for me.