MusicBrainz integration

Discuss Muso, or get help

MusicBrainz integration

Postby MDE » Wed Mar 29, 2017 1:50 pm

As mentioned in my earlier "metadata musings" I have been looking at ways of getting quality data for classical music in a more automatic way. (BTW this is not exclusively about classical music, just that this is the most difficult genre to get right from a metadata viewpoint).
I now think that I am making some real progress. Central to the approach is MusicBrainz and SongKong.
To fix your tags, just drag the album cover from Muso onto SongKong and re-import the album folder into Muso - just two actions!
Of course, there are a few caveats, mainly (1) you need to set up the SongKong options and (2) you will probably need Muso import options.
I have gone a bit further and enabled a method of getting the 3-level structure (Group Header, Sub-header, Track) into Muso automatically from MusicBrainz via SongKong. To make this work (currently) requires an additional step - to run an Mp3tag action. I hope that this step can be eliminated if SongKong incorporates a scripting component.
The results are illustrated below:

Note that (in the latest release of Muso) there is a link that will take you to all the details of the release at MusicBrainz.
The import actions required are:

Some notes on this: #WORK will contain a double colon if there is a sub-heading. #WORK_TYPE adds a sub-genre from MusicBrainz (#PART_TYPE could be added too). #ARTISTS is used, not @Artist, as it is multi-record. The SongKong options are set not to write ALBUMARTIST so that Muso can use its own logic.
Finally, if anyone is interested in the Mp3tag action, here it is:

Please note that this action is still undergoing a bit of development. Some work with regex has been necessary to deal with possible inconsistencies in the MusicBrainz data - this could be beefed up slightly.
Note that in the first picture, there are track titles with {some words in curly brackets}. This is where there is a difference between the (canonical) work-compostion name in MusicBrainz and the Movement title that SongKong derives (usually more colloquial and may be in English when the canonical title is in the native language). More regex might remove differences due only to punctuation and accents.
Posts: 452
Joined: Sat Feb 02, 2013 12:05 am

Re: MusicBrainz integration

Postby MDE » Wed Mar 29, 2017 1:53 pm

And here is a better example of the use of {curly brackets} to give the alternative (English) composition title.
Ma Vlast.jpg
Posts: 452
Joined: Sat Feb 02, 2013 12:05 am

Re: MusicBrainz integration

Postby musoware » Thu Mar 30, 2017 6:49 am

This is great and gives Muso users an insight into what is possible with Muso and how it can work with other tools.

What do you use the MUSICBRAINZ_WORK tag for? As I understand it this is a reference to the song as an entity across all artists that recorded it. I looked into this when I was implementing the musicbrainz integration and didn't pull it into a new bespoke Muso column for the following reasons :
a) Picard didn't seem to write it, but maybe SongKong does
b) a link to the work "(Recording of ...)" appears in the track (recording) page that Muso links to (from the Muso track page)
If you pull this into a custom column what does that give you?
Site Admin
Posts: 1742
Joined: Fri Sep 14, 2012 6:50 am

Re: MusicBrainz integration

Postby MDE » Thu Mar 30, 2017 8:54 am

Firstly re the MusicBrainz metadata. The tag that Picard calls Work is what SongKong calls MUSICBRAINZ_WORK_COMPOSITION (or at least I believe so - curiously Paul's own documentation at does not show this). This is the relationship "recording of" in MB. SongKong uses this as the starting point to traverse up the MB work hierarchy until it gets to the top-level containing work, which it calls MUSICBRAINZB_WORK. The intervening levels (if any) are written as MUSICBRAINZ_WORK_PART_LEVELn where n is 1-6, 1 being the lowest level. If there is no hierarchy then MUSICBRAINZ_WORK=MUSICBRAINZ_WORK_COMPOSITION .
Clearly this is only really of interest in classical music, where lots of different performers record previously-composed works. The MB metadata records the works once (in theory) according to (fairly) strict style guidelines and so can be considered the canonical form of this metadata. For non-classical music, the tags still exist, but they are usually all the same and =Title=Movement.
Thus, to answer your first question, the MUSICBRAINZ_WORK tag will be the same regardless of the recording and what title has been given to the work on an album. It is therefore the ideal tag to use in a hierarchy such as Composer->Work as it will gather together all recordings of the same work, whatever they are called on the album.
I decided to go one step further and use the MUSICBRAINZ_... tags to populate the Muso 3-tier structure. So now the Muso album display uses the canonical form (if present) with any differences from the album description at the Composition (bottom) level shown in {} - this is particularly nice in multi-language situations (typical in classical music), I think. LMS will just display Title, which is unchanged (so long as you don't write tags from Muso!).
A slight wrinkle is that the MB metadata sort-of repeats the higher level work text in each lower level, so I use regex to remove the duplication where possible; a further wrinkle is that the duplication is sometimes slightly different, either accidentally or with good reason, so the regex attempts to ignore differences of spacing, punctuation and case. If it can't remove the duplication then the full lower-level work name will be used.
Re (a) You are right - Picard only writes the lowest (Composition) level work name. I did consider writing a plug-in for Picard (still an option), but SongKong was already there (unique feature, I think).
Re (b) "Recording of" is MUSICBRAINZ_WORK_COMPOSITION - i.e. the lowest level with all the work name including the movement.
I'm still working on the Mp3tag action as there are a few improvements that could be made. Also, at first I was trying to avoid using Mp3tag, so the Import Actions are quite complex: these could be subsumed into the tag script - this would also enable a BAND tag to be created which could be used by LMS as well as Muso. I'll write it up better when it is all done. I am also very hopeful that Paul will introduce tag scripting to SongKong which will enable a custom link between SongKong and Muso without intervening steps or software.
Hope that helps.
Posts: 452
Joined: Sat Feb 02, 2013 12:05 am

Re: MusicBrainz integration

Postby paultaylor » Fri Mar 31, 2017 9:29 am

Hi, great work my Mark on this and Musoware looks very nice I am going to spend some time with it.

Regarding Picards WORK field corresponding to SongKongs MUSICBRAINZ_WORK_COMPOSITION field - that is correct, the document I gave you is uptodate wrt to SongKong/Jaikoz but perhaps slightly out of date wrt to Picard I will check. SongKong also has a WORK field which is similar, but we only populate this with classical works (not pop music works), and it maybe populated from a MusicBrainz work or from parsing the title metadata.So MUSICBRAINZ_WORK_COMPOSITION and MUSICBRAINZ_WORK are an accurate representation of what is in MusicBrainz. WORK and MOVEMENT are set to the value that most Classical uses would expect

Any questions please just ask either on this forum or the our own SongKong/Jaikoz forum
Paul Taylor (SongKong devloper)
Posts: 2
Joined: Wed Mar 29, 2017 8:30 pm

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest