Instrument database

Hello.

I saw through digging around the instruments list that there is a relational database behind each instrument (derived and further derivations) as well as a wikidata code.

Is this database available? I’m looking for a controlled vocabulary to use to describe songbooks and songs that includes what instrument they’re for. The Musicbrainz data seems perfect for this. The wikidata codes are exactly the sort of thing that ONIX can carry.

1 Like

Yes, the instruments are part of the MusicBrainz database. Depending on what you need you can download complete database dumps or use the Webservice

4 Likes

What I’m aiming to get is basically the relationships between, the wikidata number, the instrument name, and the instrument families.

We’re interested to see if this can be used to specify instruments as subject schemes for songbooks. Navigating the entire tree as produced on the website here and noting them down seems possible but labor intensive.

Getting them out of the database appears to take installing the server software and then importing the database and maybe at that point I’d have a table that I could reference? I see the instrument file in the database that I downloaded, but it has no column headings, so I don’t know what all the columns mean. And it doesn’t look it it has the wikidata number.

For instance, the end result of where we want to use the data might look like this:

<Subject>
<MainSubject/>
<SubjectSchemeIdentifier>XX</SubjectSchemeIdentifier>
        <SubjectCode>Q8347</SubjectCode>
        <SubjectHeadingText language="eng">Bagpipe</SubjectHeadingText>
</Subject>

The identifier that musicbrainz uses is not as tidy, but maybe would suffice… :thinking:

<Subject>
<MainSubject/>
<SubjectSchemeIdentifier>XX</SubjectSchemeIdentifier>
        <SubjectCode>1d865ced-d86a-4277-8914-009740e37887</SubjectCode>
        <SubjectHeadingText language="eng">Bagpipe</SubjectHeadingText>
</Subject>

That just leaves how to understand the relationships between the rows, such that bass trombone is a subset of trombone.

Do you know how I would find in the database tables that bagpipes are a subset of double reed, for instance?

This kind of relation is stored in the l_instrument_instrument table. You can find an example of SQL query using it on 6-instrument_family_tree

You can install the database alone, I think there’s one project called mbslave for that. If you don’t need to keep your base up to date (instruments change rarely), it could be easier to use the json dumps (e.g. Index of /pub/musicbrainz/data/json-dumps/) and have all the info in the instrument.tar.xz file.

There are also non-MusicBrainz solutions you might be interested in, like MIMO (Skosmos: InstrumentsKeywords: Great Highland bagpipe) or vocabularies created by French institutions (‘Mop’ on DOREMUS Vocabularies)

3 Likes