Foobar2000:Encouraged Tag Standards

From Hydrogenaudio Knowledgebase

General Tag Construction

  • Avoid the use of underscores. Spaces are easier to type, more legible, and as easily useable in Tagz. Spaces are also preferable to no spaces.
  • Use an easily understood English field name.
  • Prefix album-related information with "ALBUM ", ie. "ALBUM ARTIST", "ALBUM SUBTITLE".
  • Avoid use of non-alphabetical characters. For serial fields (for a bad example, FIELD1, FIELD2, etc.), merely enter them in the order that you wish them to be read in.

Overview of Current Recommendations =

FIELD NAME [format] (component)

  • ALBUM ARTIST [e.g., Various Artists, The Foobar Collective] (none)
    Notes: Field name is ALBUM ARTIST, with no underscore. Tag should exist if and only if an album is by multiple artists, and be contained in every track. Track-specific artists should be entered in the ARTIST tag, never in the TITLE tag.
    (more about this standard)
  • LAST PLAYED [2005-03-22 19:00:00...] (foo_playcount)
    Notes: Any amount or type of data may be placed after the time. Compliant TAGZ code shall use $substr() instead of $right() when extracting substrings from this field.
    See also: Standardize my PLAY_DATE and PLAY_TIME fields
    (more about this standard)

ALBUM ARTIST

Basics:

  • the tag-fieldname used for declaring and describing albums/split-EPs or split-singles which contain various artists is "ALBUM ARTIST" (seperated with space, not underscore)
  • tag should only exist if an album contains various artists. It should NOT be created when an album does not contain various artists.
  • the tag can contain the overall artist of an album(like i.e. "the foo-bar collective"), multiple artists(i.e. with split-EPs) or if an album does not have a clear overall artist (for example with compilations) just "Various Artists". Simply said: you're free to enter whatever you like as long as it describes the overall album-wide artist(s).
  • every track in a V.A.-album has to contain this tag with the same value
  • the track-specific artist should be entered into the ARTIST-tag
  • the TITLE-tag should only contain the track-title

Reasons for this standard:

  • it solves all issues regarding albums which contain multiple artists with just one tag
  • it is already in widespread use
  • sortable and searchable with low effort
  • keeping the ARTIST-tag trackspecific allows to find tracks in V.A.-albums as well when searching for a certain artist (DB-friendly)
  • keeping the TITLE-tag title-specific allows sorting and searching of V.A.-albums by title (DB-friendly)
  • allows meaningful determination and display of V.A.-Albums with a minimum amount of code
  • avoids resource-hungry and unsafe "guessing" of V.A.-albums via the filepath
  • easy to remember and type in manually
  • does not disrupt existing systems when the ARTIST- and TITLE-tag are already trackspecific (easy transition)
  • can coexist with additional directory-based sorting and marking
  • can be used for split-EPs and split-singles as well

Code snippets:

// check if an album is V.A.
$if(%album artist%,$puts(album_is_va,1))
// For sorting by artist in an album-context replace %artist% - %album% with:
$if2(%album artist%,%artist%) - %album%
// singlemode display without %album artist%-support
[%artist% - ][%album% - ][%title%]
// singlemode display with %album artist%-support
// note: if your display supports both, albummode and singlemode, then you
// may want to use the above version instead in singlemode - depends on taste
[$if2(%album artist%,%artist%) - ][%album% - ]$if(%album artist%,[%artist% - ])[%title%]
// How to easily integrate %album artist% into an albummode-display:
// in the albummode-column, replace %artist% with:
$if2(%album artist%,[%artist%])
// in the title-column, replace %title% with:
$if(%album artist%,[%artist% - ])[%title%]

LAST PLAYED

Basics:

  • the tag-fieldname used for storing info when a song was played the last time is "LAST PLAYED"
  • tag contains date and time in the following format at the beginning: "YYYY-MM-DD HH:MM:SS" (with 24hours-format)
  • additional info may be appended after the above info

Reasons for this standard:

  • the APE-dateformat (derived from ISO) is internationally neutral
  • sortable
  • easily readable and recognizable
  • format can be verified with TAGZ
  • can be included in formatting-strings without reformatting it (pro for amateur tagz-coders)
  • choosing a new fieldname avoids confusion with the existing ambigious play_date tag
  • field name is easy to understand/recognize/remember and short enough to type in manually
  • field name uses space instead of underscore, which is easier to type and has no other issues.

Code snippets:

// verify tag-format (we check the pos. of the first dash and ":")
// using $len for verification is strongly unrecommended!
$if(
$and($strcmp($strstr(%last played%,-),5),$strcmp($strstr(%last played%,:),14))
,$puts(last_played_is_valid,1)
)
// disassemble the timestamp for later reformatting or calcuations
$puts(last_played_year,$substr(%last played%,1,4))
$puts(last_played_month,$substr(%last played%,6,7))
$puts(last_played_day,$substr(%last played%,9,10))
$puts(last_played_hour,$substr(%last played%,12,13))
$puts(last_played_min,$substr(%last played%,15,16))
$puts(last_played_sec,$substr(%last played%,18,19))
// display only the date of last_played (without reformatting)
$left(%last played%,10)
// display only the time of last_played (without reformatting)
// the use of $right is strongly unrecommended!
$substr(%last played%,12,19)

Obsolete and Deprecated Tag Standards

PLAY_DATE and PLAY_TIME

Deprecated tags produced by old versions of foo_playcount. Default format DDMMYY for PLAY_DATE and HHMMSS (24hr) for PLAY_TIME. See LAST_PLAYED.