Foobar2000:Encouraged Tag Standards

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
Foobar2000_Logo.png

Disclaimer

The guidelines described in this document have been agreed upon by a group of foobar2000 users and titleformatting scripts authors. Adherence to these guidelines is not required to be able to use foobar2000, though some components or pre-made titleformatting scripts may require or enforce the use of a particular tag.

Discussion and comments

You can leave comments about this page on the Talk page. However, real discussion, proposals for new tag-standards, and decisions should happen in the forum-thread, because more people will notice it there and be able to give input.

Codesnippets and foobar2000 versions

The codesnippets are meant for use in foobar2000 v0.9. Because of the new field-remappings introduced in v0.9, they do not work with older versions of foobar2000.

General Tag Construction

  • 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.
  • Try to 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.

Overview of Current Recommendations

Note: Since version 1.1.8 (released on 2011-09-20), foobar2000 writes to the field ALBUMARTIST instead of ALBUM ARTIST for Vorbis Comment. The purpose of this change is to increase compatibility with other programs. There is an advanced preference to use the old behavior. foobar2000 supports reading of both fields.

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)
  • FIRST_PLAYED and LAST_PLAYED [2005-03-22 19:00:00...] (foo_playcount)
    Notes: These two tags use underscores instead of spaces - reason for this was to make it consistent with the already existing PLAY_COUNTER-tag. 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" (separated 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 e.g. "the foo-bar collective",) multiple artists (e.g. 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 track specific (easy transition)
  • can coexist with additional directory-based sorting and marking
  • can be used for split-EPs and split-singles as well
  • supported by Field Remappings in foobar2000 0.9

Code snippets:

// check if an album is V.A.
$if($meta_test(album artist),$puts(album_is_va,1))
// For sorting by artist in an album-context replace %artist% - %album% with:
%album 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
[%album artist% - ][%album% - ][%track artist% - ][%title%]
// How to easily integrate %album artist% into an albummode-display:
// in the albummode-column, replace %artist% with:
[%album artist%]
// in the title-column, replace %title% with:
[%track artist% - ][%title%]

FIRST_PLAYED and LAST_PLAYED

Basics:

  • the tag-fieldname used for storing info when a song was played the first time is "FIRST_PLAYED"
  • the tag-fieldname used for storing info when a song was played the last time is "LAST_PLAYED"
  • tags contain 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

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)

The above code-snippets can be used for FIRST_PLAYED as well (just replace last_played with first_played).

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 FIRST_PLAYED and LAST_PLAYED.