MusicBrainz

From BC$ MobileTV Wiki
Revision as of 11:53, 13 August 2021 by Bcmoney (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MusicBrainz is the leading provider of open source music metadata for musical Artists, Albums, and Tracks. [1]

Specifications

Community

MusicBrainz was one of the first major online music communities and also one of the wiki-style open information collaboration tools (pre-dating even Wikipedia, as it began around January 2000[2] (one full year before Wikipedia was launched) as a scalable music metadatabase that attempts to create a comprehensive music information site. While it started primarily as an academic project by several music enthusiasts, it quickly grew into a popular service and active international open source community project with contributors all over the world. The founders cited a desire to create an open alternative to the CDDB which was taken over by GraceNote, the world's largest (at the time) music database, CD identification service, purveyor of Music statistics and music information.[3] While a free version of the last non-proprietary version of CDDB is still available at FreeDB, it is technically inferior in several ways (mostly because it is based on a flat file format not relational database) and contains many more duplicates than MusicBrainz.

Its success is largely attributed to it's openness, which stands in stark contrast to the proprietary music databases of the day. You can use the MusicBrainz data either by browsing this web site, or you can access the data from a client program — for example, a CD player program can use MusicBrainz to identify CDs and provide information about the CD, about the artist or about related information. You can also use the MusicBrainz Tagger to automatically identify and clean up the metadata tags in your digital music collections.

In 2005 MetaBrainz was founded to official take over the day-to-day administration of MusicBrainz (as it had grown too large for the hobbyist creators to manage), and control was handed over on April 19th, 2005.[4] At this point, many large donations came in, including from Google and Rick Jones (co-found of Last.fm).[5]


Database


Web Service

Version 1.0

The MusicBrainz Web Service, v1.0 will be phased out until late 2011.


Version 2.0

As of 2012, v2.0 is the only way to use the MusicBrainz API.


MusicBrainz ID

MusicBrainz ID (MBID) is more than just an auto-generated key in some database, it is similar to the CDDB Disc ID for looking up a CD based only on knowledge of the number of tracks, their length and the total album length (although it has a significantly different algorithm). Each ID number is explained here:

Here's an example, using Pearl Jam's " Vs." album:

Track# Title Duration Seconds Timeline Frame Sum CheckSum
0. LEAD-IN 0:02 2 0 150
0
--
1. Go 3:13 193 2 14672
2
2
2. Animal 2:49 169 195 27367
15
17
3. Daughter 3:56 236 364 45030
13
30
4. Glorified G 3:27 207 600 60545
6
36
5. Dissident 3:35 215 807 76707
15
51
6. W.M.A. 5:59 359 1022 103645
5
56
7. Blood 2:51 171 1381 116430
13
69
8. Rearviewmirror 4:44 284 1552 137730
13
82
9. Rats 4:15 255 1836 156887
18
100
10. Elderly Woman... 3:16 196 2091 171577
12
112
11. Leash 3:10 190 2287 185792
19
131
12. Indifference 5:02 302 2477 208500
20
151

EXAMPLE CDDB Calculation

Each CDDB Disc ID has[6]:

8 digits: XXYYYYZZ

You can caculate each as follows: XX = Checksum Total mod 255

checksum total (from table) is 151 % 255 = 151 ==> 97 in HEX

YYYY = Total Time, all tracks

album running time of 46:18 or 2778 seconds ==> ada in HEX, but we need 4 digits so it becomes 0ada

ZZ = Total Tracks

album with 12 songs, 12 ==> c in HEX, but we need two digits so it becomes 0c

Pearl Jam's album Vs.[7]

970ada0c


EXAMPLE MusicBrainz ID Calculation

The CD Index algorithm simply takes the following pieces of data and runs them through the SHA-1 hash function[8][9][10][11][12]:

   First track number (normally one): 1 byte
   Last track number: 1 byte
   Lead-out track offset: 4 bytes
   99 frame offsets: 4 bytes for each track 

To find this info for an album, use the sampling rate 44.1 kHz using 16 bits resolution per channel:

44100 x 2 bytes x 2 stereo channels = 176400 bytes of PCM data stored per second

Along with the fact that audio data is stored in logical blocks of 2352 bytes each on the CD, holding:

2352 blocks / 176400 bytes = 1 block / 75 seconds of sound

Each logical block has 882 bytes of error correction and control data that needs to be accounted for, giving:

882 * tracks ==> 882 * 12 = 10584 padding blocks


Again, for Pearl Jam's Vs. we get the following:

track 1:        150    (150 + 0)
track 2:        14822  (150 + 14672)
track 3:        27517  (150 + 27367)
track 4:        45180  (150 + 45030)
track 5:        60695  (150 + 60545)
track 6:        76857  (150 + 76707)
track 7:        103795  (150 + 103645)
track 8:        116580  (150 + 116430)
track 9:        138030  (150 + 137880)
track 10:       157037  (150 + 156887)
track 11:       171727  (150 + 171577)
track 12:       185942  (150 + 185792)
lead-out track: 208650  (150 + 208500)

Which gives us the MBID:

7244f710-6090-43a2-a4e0-772623d71cf5


Tools


Resources


Tutorials


External Links


References

  1. http://musicbrainz.org
  2. MusicBrainz project - User Group/Mailing list: http://lists.musicbrainz.org/pipermail/musicbrainz-users/
  3. About MusicBrainz: http://musicbrainz.org/doc/About_MusicBrainz
  4. MetaBrainz Launches: http://blog.musicbrainz.org/?p=102
  5. MetaBrainz sponsors: http://musicbrainz.org/doc/MusicBrainz_Sponsors
  6. Example calculation of a CDDB (FreeDB/Gracenote) disc ID: http://medlibrary.org/medwiki/CDDB#Example_calculation_of_a_CDDB1_.28FreeDB.29_disc_ID
  7. CDDB.java: http://introcs.cs.princeton.edu/java/51data/CDDB.java.html
  8. Disc ID Calculation: http://musicbrainz.org/doc/Disc_ID_Calculation
  9. MusicBrainz DiscID - wiki: http://wiki.musicbrainz.org/Disc_ID_Calculation
  10. Convert text to Uppercase: http://www.convertcase.net/
  11. SHA-1 Calculator: http://www.xorbin.com/tools/sha1-hash-calculator
  12. Base-64 Encoder/Decoder: http://www.motobit.com/util/base64-decoder-encoder.asp
  13. Source Code: https://gist.github.com/766668

See Also

Music | Linked Data