MusicBrainz introducing: Genres!

One of the things various people have asked MusicBrainz for time and time again has been genres. However, genres are hard to do right and they’re very much subjective—with MusicBrainz dealing almost exclusively with objective data. It’s been a recurring discussion on almost all of our summits, but a couple years ago (with some help from our friend Alastair Porter and his research colleagues at UPF), we finally came to a path forward—and recently Nicolás Tamargo (reosarevok) finally turned that path forward into code… which has now been released! You can see it in action on e.g., Nine Inch Nails’ Year Zero release group.

How does it work?

For now genres are exactly the same as (folksonomy) tags behind the scenes; some tags simply have become the chosen ones and are listed and presented as genres. The list of which tags are considered as genres is currently hardcoded, and no doubt it is missing a lot of our users’ favourite genres. We plan to expand the genre list based on your requests, so if you find a genre that is missing from it, request it by adding a style ticket with the “Genres” component.

As we mentioned above, genres are very subjective, so just like with folksonomy tags, you can upvote and downvote genres you agree or disagree with on any given entity, and you can also submit genre(s) for the entity that no one has added yet.

What about the API?

A bunch of the people asking for genres in MusicBrainz have been application developers, and this type of people are usually more interested in how to actually extract the genres from our data.

The method to request genres mirrors that of tags: you can use inc=genres to get all the genres everyone has proposed for the entity, or inc=user-genres to get all the genres you have proposed yourself (or both!). For the same release group as before, you’d want for the XML API and for the JSON API.

Since genres are tags, all the genres will continue to be served with inc=tags as before as well. As such, you can always use the tag endpoint if you would rather filter the tags by your own genre list rather than follow the MusicBrainz one, or if you want to also get other non-genre tags (maybe you want moods, or maybe you’re really interested in finding artists who perform hip hop music and were murdered – we won’t stop you!).

I use the database directly, not the API

You can parse the taggenres from entities.json in the root of the “musicbrainz-server” repository which will give you a list of what we currently consider genres. Then you can simply compare any folksonomy tags from the %_tag tables.

Note about licensing

One thing to keep in mind for any data consumers out there is that, as per our data licensing, tags—and thus also genres—are not part of our “core (CC0-licensed) data”, but rather part of our “supplementary data” which is available under a Creative Commons Attribution-ShareAlike-NonCommercial license. Thus, if you wish to use our genre data for something commercial, you should get a commercial use license from the MetaBrainz Foundation. (Of course, if you’re going to provide a commercial product using data from MusicBrainz, you should always sign up as a supporter regardless. :)).

The future?

We are hoping to get a better coverage of genres (especially genres outside of the Western tradition, of which we have a very small amount right now) with your help! That applies both to expanding the genre list and actually applying genres to entities. For the latter, remember that everyone can downvote your genre suggestion if they don’t agree, so don’t think too much about “what genres does the world think apply to this artist/release/whatever”. Just add what you feel is right; if everyone does that we’ll get much better information. 🙂

In the near future we’re hoping to move the genre list from the code to the database (which shouldn’t mean too much for most of you, other than less waiting between a new genre being proposed for the list and it being added, but is much better for future development). Also planned is a way to indicate that several tags are the same genre (so that if you tag something as “hiphop”, “hip hop” or “hip-hop” the system will understand that’s really all the same). Further down the line, who knows! We might eventually make genres into limited entities of a sort, in order to allow linking to, say, the appropriate Wikidata/Wikipedia pages. We might do some fun stuff. Time will tell!

Author: Freso

MetaBrainz Community Manager. B-boy. Smurf.

23 thoughts on “MusicBrainz introducing: Genres!”

  1. There is no such genre as “experimental”, it is just a fancy tag some people use. What can be considered today as experimental will become mainstream tomorrow. What is experimental to some is ordinary to others. This is extremely subjective. Please remove “experimental” from the genre list.

  2. All genres are extremely subjective 🙂 I personally agree “experimental” is not the most useful label to give to something (other people have said the same about “singer-songwriter”, which is also a fair complaint). That said, given the system works in a way where there is no “one true genre” for an entity, but a selection of genres that other users can vote up or down if they agree or disagree, I don’t feel having wider, maybe less useful genres is a problem. I will personally also probably ignore wide genres like “metal” (what metal? I like doom metal but not power metal), but it doesn’t hurt to allow them for people who have a use for them 🙂

  3. One should distinguish between the subjectivity of assigning a genre and a subjective genre itself. I will change my opinion on this once somebody gives a reasonable definition of “experimental” as a genre.

    As for your “metal” example, I think genres like this still might have place. Sometimes there are cross-genre works and there is no better option than to use such a generic genre. For example, as much as I hate “electronic” used as a genre, sometimes it is the most reasonable word to succinctly communicate some meaning.

  4. Both are added through the same form 🙂 If it’s a genre it ends under genre, if not under other tags.

  5. After having a little play with this – this is great work!

    Do you think that a link to a website defining the genre (perhaps wikipedia) for each label would be heplful?

    There is some genre information already in “other tags” – is there any plan to transfer this info into the “Genres” portion of the tag?

  6. If genres on “other tags” are added to the genre list, they’ll automatically be moved to “genres” 🙂 If you find some genre that is missing, the post mentions how to request them.

    Ideally, yes, I’d love to add links and other info to genres. That’ll take quite a bit longer though, because for that genres need to be more than just a list on top of tags, but it’s something I do want to look into in the future.

  7. Sophist: I’d expect it needs an update.

    PoQStacker: no, but you can always only take the n genres with the most votes.

  8. API examples provided above have led me to a couple of (technical) questions:-

    1) Some Genre counts have a value of 0 (zero) – is there any reasoning behind that?

    2) Is it safe for me to assume that count values will NOT be negative?

    3) What is the variable type of the count value (eg 32 bit integer)?

    3) Is it safe for me to assume that all genre names will be represented by UTF8 characters?

  9. I have been testing the API further and I have another question – when I make a query (CD content in my testing) using the MBID with the “inc=artists+labels+recordings+release-groups+artist-credits+genres” options, it gives me the genres for the CD collection, but the genres for the individual tracks is omitted.

    I then have to query each of the individual tracks (using their MBID) with “inc=genres”.

    Is this the intended operation?

  10. > I then have to query each of the individual tracks (using their MBID) with “inc=genres”.

    IMO this is a significant issue that needs to be fixed – because rather than one web service call for an album it will result in (say) 21 web service calls with a consequent impact on both server load AND the elapsed time required for the user’s tagging tool (like Picard) to get all the data it needs.

  11. > 1) Some Genre counts have a value of 0 (zero) – is there any reasoning behind that?
    They have been added by one person, but downvoted by another – so there’s no consensus the genre really applies, but you might still want it if you want all genres *anyone* has given to an entity.

    > 2) Is it safe for me to assume that count values will NOT be negative?
    No. I’ve downvoted “heavy metal” now (because I don’t think this is a heavy metal album) and with that it’s gone from 0 to -1. That just means there’s more people who think this genre does not apply than people who think it does, but again, see previous answer for why we still show it 🙂

    > 3) What is the variable type of the count value (eg 32 bit integer)?
    INTEGER NOT NULL (on Postgres)

    > 4) Is it safe for me to assume that all genre names will be represented by UTF8 characters?
    I would expect so. It is not safe to assume ASCII or even Latin-1 though 🙂

    > it gives me the genres for the CD collection, but the genres for the individual tracks is omitted.
    Huh. On I’m getting a genre list for each recording. Don’t you?

  12. I see Genres at both Release Group and Recording level in the XML. But looking at the web pages for this release/release group I can see:

    * Release Group has several Genres
    * Release has a Genres section but without any Genres
    * Tracks don’t seem to be able to have Genres (and Recording Genres do not show up on the Release Web page)
    * Recordings have genres – but you can only see them when you click on a track to go to the web page for the individual recording

    Which raises five sets of questions in my mind:
    1. Release vs Release Group: Why are you able to define Genres at both Release and Release Group level? Does this make sense (because RG can contain several Releases which actually have different genres – which would seem to make little sense – and could give rise to RG and Release having radically different genres which would be very confusing)? Would it make more sense to only allow Genres at only the RG or only the Release level?

    2. Visibility of Recording Genres on Release web page: I think the release web page needs to be enhanced to summarise the genres for the associated recording for each track.

    3. Recording Genres vs Release/Release Group genres: I am comfortable that it is possible for a Release/RG to have a different set of genres than an individual recording, but surely if all the recordings are e.g. Heavy Metal, it would not make sense to allow the Release/RG to be labelled Pop. Should there be some sort of summarising of all the recording genres in order either to compare with the Release/RG genres for consistency or even perhaps to provide a default set of Release/RG genres.

    4. Media genres: I can envisage a situation where a multi-CD album has a CD with Heavy Metal and another with acoustic versions of the same tracks. Does it make sense to have Media-level Genres?

    5. Reducing Subjectivism: Previous genre implementations (by others) have ended up with the genre list being polluted by excessive numbers of different spellings or bizarre names – and unless you have a reasonably small, core, stable & moderated list, this can easily get out of hand. Is the MB implementation designed to deliver a small stable list of genres? Similarly if the MB genres are based on subjective votes, we need to provide explanations of what a genre is and how it differs from other similar genres so people can vote accurately rather than mistakenly, and these need to be visible on the voting screen(s) in whichever client is used for voting. Indeed, though it may be difficult or impossible to enforce, displaying these explanations should be mandatory.

    P.S. These questions are not intended to disrespect the work already done – Genres are IMO a very welcome addition – but instead to highlight inconsistencies that may need to be ironed out.

  13. I agree with you @Sophist. I am new at MB and I am still coming to terms with where’s-what in the database, and the web pages user interface…

    Should users be able to vote on the genre for an artist? I would think that the genre for an artist should be the summary of genres for their recorded tracks – and perhaps the count values should the number of tracks with that genre.

    I do think that users should be able to vote on the genre of a collection (CD, album etc), but in effect, this should be incrementing (or decrementing) the genre votes on the individual tracks within the collection.

    I would like the genre list to include usage i.e “Eighties Dance”, “Meditation”. And also expand on cultural i.e. “Ethnic”, “Indigenous”.

    My questions & comments are offered in the hope that they will be helpful.

  14. I don’t care if it doesn’t suit everyone’s own meticulous definition of perfect, just thank you for finally addressing this issue. big ups!

  15. “I would like the genre list to include usage i.e “Eighties Dance”, “Meditation”. And also expand on cultural i.e. “Ethnic”, “Indigenous”. ”
    I believe that is exactly what the “folksonomy tags” (just “other tags”) is for

  16. For the JSON vs XML difference: I’m looking into that – seems it’s always been like that with tags but I see no good reason for it so we might just change it.

    For other more general questions, feel free to open a thread in the forum ( about them! 🙂

  17. @msw141 – I agree. But like most of these types of things – they evolve. It’s great to be apart of a conversation that perhaps has an influence over the evolutionary path…

    @reosarevok – Thank you very much for that. I’m committed to using JSON as the interface to MB. I will continue to query each of the individual tracks (using their MBID) with “inc=genres” as a work-around in the short term.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.