The m-TAGS format offers a simple and powerful solution to the media-metadata separation problem (see the Media vs. Metadata section). An m-TAGS file contains metadata and a locator which identifies the media file to which the metadata applies. Here is an example:


[{
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/01. MANDY.mp3",
      "ALBUM" : "THE ESSENTIAL",
      "ALBUM ARTIST" : "BARRY MANILOW",
      "ARTIST" : "BARRY MANILOW",
      "COMPOSER" : "RICHARD KERR / SCOTT ENGLISH",
      "DATE" : "1974",
      "DISCNUMBER" : "01",
      "TITLE" : "MANDY",
      "TRACKNUMBER" : "1",
}]

The format is very simple. Each tag is represented by a pair "<tag name>" : "<tag value>". The special notation "<tag name>" : [] is used to explicitely specify that a certain tag does NOT have a value (the main reason for this notation will become apparent later on). The "@" locator tag contains the location of the media source. In this case it is a file on the local system (see the Specification for additional information on the "@" locator tag). This format allows to define any tag name and to assign any value to a tag. Tags can be multivalued, too. For example, we may decide to tag the same media with:


[{
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/01. MANDY.mp3",
      "ALBUM" : "THE ESSENTIAL",
      "ALBUM ARTIST" : "BARRY MANILOW",
      "ARTIST" : "BARRY MANILOW",
      "COMPOSER" : ["RICHARD KERR", "SCOTT ENGLISH"],
      "DATE" : "1974",
      "DISCNUMBER" : "01",
      "TITLE" : "MANDY",
      "TRACKNUMBER" : "1",
}]

In this case, the "COMPOSER" tag contains an array with two distinct values, rather than a single value.

An m-TAGS file can also contain metadata information about several media sources, or several parts of the same media source. In this case, each metadata section (tag set) is contained between a pair of curly brackets "{}":


[{
   "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|1",
   "ALBUM" : "THE ESSENTIAL",
   "ALBUM ARTIST" : "BARRY MANILOW",
   "ARTIST" : "BARRY MANILOW",
   "COMPOSER" : "RICHARD KERR / SCOTT ENGLISH",
   "DATE" : "1974",
   "DISCNUMBER" : "01",
   "TITLE" : "MANDY",
   "TOTALTRACKS" : "17",
   "TRACKNUMBER" : "1"
},
{
   "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|2",
   "ALBUM" : "THE ESSENTIAL",
   "ALBUM ARTIST" : "BARRY MANILOW",
   "ARTIST" : "BARRY MANILOW",
   "COMPOSER" : "BARRY MANILOW / MARTY PANZER",
   "DATE" : "1974",
   "DISCNUMBER" : "01",
   "TITLE" : "IT'S A MIRACLE [SINGLE EDIT]",
   "TOTALTRACKS" : "17",
   "TRACKNUMBER" : "2"
},
{
   "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|3",
   "ALBUM" : "THE ESSENTIAL",
   "ALBUM ARTIST" : "BARRY MANILOW",
   "ARTIST" : "BARRY MANILOW",
   "COMPOSER" : "BARRY MANILOW / ADRIENNE ANDERSON",
   "DATE" : "1973",
   "DISCNUMBER" : "01",
   "TITLE" : "COULD IT BE MAGIC",
   "TOTALTRACKS" : "17",
   "TRACKNUMBER" : "3"
},
{
   "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|4",
   "ALBUM" : "THE ESSENTIAL",
   "ALBUM ARTIST" : "BARRY MANILOW",
   "ARTIST" : "BARRY MANILOW",
   "COMPOSER" : "BRUCE JOHNSTON",
   "DATE" : "1975",
   "DISCNUMBER" : "01",
   "TITLE" : "I WRITE THE SONGS [SINGLE EDIT]",
   "TOTALTRACKS" : "17",
   "TRACKNUMBER" : "4"
},
...
]

It should be noticed that the above example indicates as the media source for all tag sets a single CUE file. The CUE file contains references to media files, so a media player can play all cues, tagged according to the contents of the m-TAGS file. The last portion of the location tag indicates the track number in the CUE file.

The above example represents an m-TAG file where all tags are specified for each track (or part). In reality, m-TAGS files support a mechanism to shorten the notation, if certain tags apply to several tracks. The following parsing rule is applied to an m-TAGS file:

"If a tag set does not contain a tag, the value of that tag is the same as that tag's value in the previous set"

Therefore, the following m-TAGS file is semantically equivalent to the previous one:


[
   {
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|1",
      "ALBUM" : "THE ESSENTIAL",
      "ALBUM ARTIST" : "BARRY MANILOW",
      "ARTIST" : "BARRY MANILOW",
      "COMPOSER" : "RICHARD KERR / SCOTT ENGLISH",
      "DATE" : "1974",
      "DISCNUMBER" : "01",
      "TITLE" : "MANDY",
      "TOTALTRACKS" : "17",
      "TRACKNUMBER" : "1"
   },
   {
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|2",
      "COMPOSER" : "BARRY MANILOW / MARTY PANZER",
      "TITLE" : "IT'S A MIRACLE [SINGLE EDIT]",
      "TRACKNUMBER" : "2"
   },
   {
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|3",
      "COMPOSER" : "BARRY MANILOW / ADRIENNE ANDERSON",
      "DATE" : "1973",
      "TITLE" : "COULD IT BE MAGIC",
      "TRACKNUMBER" : "3"
   },
   {
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|4",
      "COMPOSER" : "BRUCE JOHNSTON",
      "DATE" : "1975",
      "TITLE" : "I WRITE THE SONGS [SINGLE EDIT]",
      "TRACKNUMBER" : "4"
   },
   ...
]

If a tag is present in a given section but not in the one that follows, than the notation "<tag name>" : [ ] is used to specify that the tag is absent. For example:


[
   {
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|1",
      "ALBUM" : "THE ESSENTIAL",
      "ALBUM ARTIST" : "BARRY MANILOW",
      "ARTIST" : "BARRY MANILOW",
      "COMPOSER" : "RICHARD KERR / SCOTT ENGLISH",
      "DATE" : "1974",
      "DISCNUMBER" : "01",
      "TITLE" : "MANDY",
      "TOTALTRACKS" : "17",
      "TRACKNUMBER" : "1",
      "COMMENT" : "BARRY'S GREATEST HIT"
   },
   {
      "@" : "/H:/MUSIC/POPULAR/ARTISTS/B/BARRY MANILOW/THE ESSENTIAL/CD 01/tracks.cue|2",
      "COMPOSER" : "BARRY MANILOW / MARTY PANZER",
      "TITLE" : "IT'S A MIRACLE [SINGLE EDIT]",
      "TRACKNUMBER" : "2",
      "COMMENT" : []
   },
   ...
]


m-TAGS and JSON

Many people will recognize the similarity between the m-TAGS format and the JSON (JavaScript Object Notation) format. This is not coincidental. The m-TAGS format is designed to be compatible with the JSON format. Formally, an m-TAGS file contains a JSON array value. The array contains object values, which specify the tags for a media source. Each tag value is a string, or an array of strings. This means that m-TAGS files can be parsed by any JSON parser, and they can therefore be easily integrated in any JSON-based platform.

m-TAGS and playlists

Because the m-TAGS format allows to define location and metadata for multiple files, an m-TAGS file may be, in principle, used as a playlist. In general, a playlist contains references to media resources than can be loaded into an application capable of understanding the playlist format.

There is, however, an important difference between a playlist and an m-TAGS file. An m-TAGS file, unlike a playlist, "encapsulates" the media resources it identifies. Media players and media taggers typically load resource using a playlist, but all tagging operations are carried out directly on the media files, and not on the playlist file (which in most cases has little or no tagging "capability"). Conversely, when a resource is loaded through an m-TAGS file, an application applies all tagging operations on the m-TAGS file, and NOT to the resource, which is effectively treated as "read-only".


(c) Luigi Mercurio