Tagging

Musium reads metadata from flac tags (also called Vorbis comments) and maps those to its internal schema. Musium expects files to be tagged properly, and it expects the tags to be consistent across files.

Because Musium uses internal ids based on MusicBrainz ids of albums and artists, MusicBrainz ids are required. Files tagged with MusicBrainz Picard are fine in most cases, although for albums credited to multiple artists, additional configuration might be needed, see the section about multiple album artists below.

Schema

The Musium library consists of a collection of albums. Every album belongs to one or more artists, and every artist has one or more albums. Every album has one or more tracks. The track artist can differ from the album artist (for example, to accomodate feat. artists).

For artists, albums, and tracks, Musium stores the following attributes:

Artist

  • Name
  • Sort name

Album

  • Title
  • Original release date
  • Artist name as credited
  • First seen (import time or time of first play)

Track

  • Disc number
  • Track number
  • Title
  • Artist
  • Duration

Tags

Musium reads metadata from the following tags. Unless specified otherwise, all tags are mandatory and must occur exactly once. Note that duration is not read from the metadata, it is determined from the flac header instead.

discnumber

Disc number, a non-negative integer less than 16. Defaults to 1 if not provided.

tracknumber

Track number, a non-negative integer less than 256.

title

Track title.

artist

Track artist.

album

Title of the album.

albumartist

Name of the album artist.

albumartists

Optionally, for a collaboration album, the names of each artist separately. This tag should then occur multiple times, once per artist. See also the section on multiple album artists below. When albumartists are provided, albumartist should contain the joined name. For example, if albumartists is provided twice, once with value John Legend and once with The Roots, albumartist might be set to John Legend & The Roots.

albumartistsort

Sort name of the album artist (e.g. name without articles). Defaults to the value of albumartist when not provided. For an album with multiple artists this tag is ignored, use albumartistssort (note the double s) instead for collaboration albums.

albumartistssort

Optionally, the sort name of each album artist separately, to match albumartists. Defaults to the values in albumartists when not provided.

originaldate

Original release date of the album in YYYY-MM-DD format. If an exact date is not known, YYYY-MM and YYYY can be used instead.

date

If originaldate is not provided, this field is used instead.

musicbrainz_albumartistid

MusicBrainz id to group albums under. This can occur multiple times, see also the section on multiple album artists below.

musicbrainz_albumid

MusicBrainz id to group tracks under.

Consistency

Tags contain redundant information, which must be consistent. For example, all tracks on the same album should have the same album artist and album title.

Musium uses the MusicBrainz album id to determine what album a track belongs to, and the MusicBrainz album artist id to determine which artist an album belongs to. The directory structure of the files is irrelevant. If there is an inconsistency, Musium reports it, and it will then make an arbitrary choice about what version to keep.

Multiple album artists

Collaboration albums are sometimes credited to multiple artists. (As opposed to compliation albums, which are usually credited to a single special artist named Various Artists.) There are different ways to represent this with tags:

  1. Treat every combination of existing artists as a new artist, with a unique musicbrainz_albumartistid.
  2. Credit the album only to a single primary artist.
  3. Credit the album to multiple artists, with multiple musicbrainz_albumartistid tags, and multiple albumartists tags in addition to the standard albumartist tag.

Option 1 and 2 are more widely supported across music players, but their downside is that the album will not show up in the discography of every credited artist. For example, if you tag Wake Up! by John Legend & The Roots with only John Legend as the album artist, then it will not show up in the album list of The Roots, and if you tag it with John Legend & The Roots as album artist, then it will neither show up under John Legend nor under The Roots. If the track artist of individual tracks lists all artists, Musium is still able to find those tracks individually in search by searching for any of the artists.

Before Musium version 0.11.0, albums in Musium belonged to exactly one artist, so option 1 and 2 were the only ways of tagging a collaboration album. Since Musium 0.11.0, Musium supports multiple artists per album, and option 3 is possible. However, this requires an additional tag that Picard does not write by default. Musium needs:

  • The name of the collaboration that the album is credited to in the albumartist tag. This tag should occur exactly once.
  • The MusicBrainz ids of the individual artists in the musicbrainz_albumartistid tag. This tag should occur multiple times, once per artist.
  • The names of the individual artists in the albumartists tag. This tag should occur multiple times, once per artist, and in the same order as the ids.
  • Optionally, albumartistssort. If this tag is present, it must occur as many times as albumartists, and list artists in the same order.

To make Picard write the albumartists tags you need the Additional Artist Variables plugin, which is distributed with Picard, but not enabled by default. In the Picard settings:

  • Enable Additional Artist Variables under Plugins.
  • In Scripting, create a new tagger script.
  • Add the following expression:
$setmulti(albumartists,%_artists_album_all_std_multi%)
$setmulti(albumartistssort,%_artists_album_all_sort_multi%)

This should be sufficient to make Musium handle the collaboration albums.

Note, in some cases it is not so clear what constitutes a collaboration. For example, after releasing multiple albums together, the members of drum ’n bass duo Fred V & Grafix each released solo albums under the names Fred V and Grafix, and their earlier albums are not considered collaborations (at least in MusicBrainz), Fred V & Grafix is its own separate artist. On the other hand, drum ’n bass artists Sub Focus and Wilkinson did release a collaboration album that is credited to both of the existing artists, the collaboration is not considered a new artist. When artists collaborate under a new name (for example, Kaskade and Deadmau5 as Kx5), this is generally represented as a new artist, instead of a collaboration. The line can be blurry, it’s up to you how you prefer to tag your files.