Author Topic: Managing (levels of) classical music works using MusicBee and MusicBrainz Picard  (Read 29566 times)


  • Hero Member
  • *****
  • Posts: 7998
What's this all about Alfie?

The intention of this post/tutorial is to describe a method in achieving a consistent system for tagging, filtering, displaying, and managing the different levels of classical compositions by using MusicBee, MusicBrainz' Picard tagging tool, and a tailor-made script created for this purpose.

If your music library contains some larger classical works, for e.g. displaying purposes you may have the desire to be able to achieve something resembling what you will find on the printed covers of physical releases of classical albums:

Also you may want to have some additional tagging options (virtual tags) available, optimized for organising, managing and playing your classic music.

This 'howto' attempts to be helpful in achieving that and more.
While this has expanded into a pretty long read, you can probably trust me when I say that the actual steps you'll have to perform to get this operational are not very complicated, and that the instructions are designed and worded to be as clear and straightforward as possible.


Suppose somebody accidentally slipped some classical music in your digital music playing and managing software. (never admit you did that yourself)
The first thing to understand is that an essential distinction between popular music and classical music is that while popular music could be described as a single sheet of paper (or for the purpose of convenience and commercial gains an album, a.k.a. record, cassette, CD), classical music is usually more like a book, a story, with maybe a main title, perhaps chapters and paragraphs, etc. Maybe even a volume comprised of several books.

Obviously the original composer of classical music was—and is—not hindered or obstructed that a composition should not be longer than 3 minutes to be played on the radio, or that an LP can contain only 20 minutes per side, a CD some 70 minutes, nor that a CD should really have an Album Title and an Album Artist printed somewhere behind it's ugly polycarbonate enclosure.

So, while for non-classical music it is usually sufficient to know only the name of the band, the album title and the track title, for understanding and managing classical music it is quite helpful (essential?) to have some understanding of- and be able to manage levels of works, parts, movements, etc.

Note that certainly not all classical compositions will be multi-level works though.
There are many stand-alone compositions that are not part of an overarching work.
For the sake of this scheme and tutorial, such individual compositions will not be considered to be a 'work', and so the 'work' tag for those will remain empty, and they could be treated similar to a regular pop song.
Only compositions constructed of at least two levels will get a 'work' tag besides the 'title' tag.

These occurring varieties of compositions and levels obviously makes tagging classical music, and enjoying it on a computer a whole different ball game.

With newly acquired classical recordings, you will often find any pre-existing tags to be be inconsistent, containing sparse or incomplete information, or containing too much information and long titles cramped into one poor single tag.
Also there will be a variety in how titles or work/composition levels are constructed, or e.g. you'll see differences in the language chosen for the artist or the titles of the compositions.

This is where Picard & MusicBrainz, MusicBee, and this tutorial and my script can play a valuable role.
They make it possible to source very specific tagging information from the MusicBrainz database, and make it available for you to put to good use in MusicBee.

If you would just run recordings through Picard without a beforehand thought-out plan and/or the use of scripts and plugins, the results could seem disappointing.
Been there, done that.
But after lots of trial and error, and running scripts on a large amount and a variety of sorts of classical music, I have concocted a system that works quite well for me, so I thought to share it here.
If you follow the steps, you will end up with Picard automatically writing some consistently populated tags that you will be able to use in MusicBee to filter, group, organize and play your classical music.



- You have MusicBrainz' Picard installed (v2.3.2 or higher, this is important!)
    (I would suggest using a portable install, so you can e.g. set that one up solely for your classical music, and possibly using a different Picard install for your popular music)
- You have enabled the 'Classical Extras' plugin. (an impressive plugin created by MetaTunes, available through Picard > Options > Plugins)
- You are not fearing to enter a script in Picard. (don't worry, for this tutorial it's just going to be a simple copy&paste)


- You will need to setup one (yes, isn't that great? only 1!) custom tag for this to work.
- You will need to setup a couple of virtual tags. Depending on how far you want to take this, anywhere from six, up to ...


The plain steps to perform, without much ado or explanation:

1 : Picard

Make sure that under Options > Metadata you have both release- and track- relationships enabled:

(I have it set like this:)

In Picard's Options > Scripting panel, add and activate this as a script:

$set(_work_top,$if($gte($get(_cwp_work_part_levels),1),$get(_cwp_work_top)))$if($gte($get(_cwp_work_part_levels),3),$set(_temp,$find(%_cwp_work_1%,:))$set(_work_sub,$substr(%_cwp_work_1%,,$if($lt(%_temp%,0),,%_temp%)))))$if($eq($get(_cwp_work_part_levels),2),$set(_part,$get(_cwp_inter_work)))$if($eq($get(_cwp_work_part_levels),3),$set(_part,$get(_cwp_part_1)))$if($eq($get(_cwp_work_part_levels),4),$if($eq($get(_cwp_title_work_levels),4),$set(_part,$trim($substr(%_cwp_work_2%,$find(%_cwp_work_2%,:),),: )),$set(_part,%_cwp_inter_work%)),)

Apply, close Picard, and then open it again.

2 : Picard's Classical Extras plugin:

- navigate to the plugin's options panel.
- In the tab 'Works and parts', check:
   ⦁  'Use canonical work metadata enhanced with text'
   ⦁  'Full MusicBrainz work hierarchy'
   ⦁  'replace work names by aliases'

It should then look something like this:

Next, in the 'Genres etc.' tab, disable 'Include workdate in workname'.
This may not be necessary, but I am a bit apprehensive of the added parentheses it will produce that might mess up formulas further down the road.


3 : MusicBee

Create a new tag named: Picard title full

That should look like this:

Create a custom tag that links to this newly created tag:

Create these virtual tags:

Work [top]¨
$If($Contains(<Picard title full>,₁)="T",$Split($Split(<Picard title full>,₁,2),¹,1),)

Work [ sub ]¨  (Important: read the note about [ sub ] at the bottom of this post)
$If($Contains(<Picard title full>,₂)="T",$Split($Split(<Picard title full>,₂,2),²,1),)

Work [full]¨  (Important: read the note about [ sub ] at the bottom of this post)
$If($Contains(<Picard title full>,₁)="T",$If($Contains(<Picard title full>,₂)="T",<Work [top]¨> - <Work [ sub ]¨>,<Work [top]¨>),$If($Contains(<Picard title full>,₂)="T",<Work [ sub ]¨>,))

Work [adapt]¨  (Important: read the note about [ sub ] at the bottom of this post)
$If($Contains(<Picard title full>,₂)="T",<Work [ sub ]¨>,$If($Contains(<Picard title full>,₁)="T",<Work [top]¨>,))

$If($Contains(<Picard title full>,₃)="T",$Split($Split(<Picard title full>,₃,2),³,1),)

Title [piece]¨
$If($Contains(<Picard title full>,₄)="T",$Split($Split(<Picard title full>,₄,2),⁴,1),)

(Note the minuscule tremas ¨ used at the end of the tag names. That's just a habit of mine, only to make it a bit more obvious in the panel headers of MusicBee to see that a tag is a virtual tag)

Those are pretty much all the necessary initial steps.

What you now have—after you have run a release successfully through Picard and imported it into MusicBee—is:

One custom tag
  named 'Picard title full' that is constructed like this:

₁work top¹₂work sub²₃part³₄title piece⁴

You can pretty much ignore it, but do understand that this is the source tag that all virtual tags will rely on as a source to retrieve their information from. So guard it with your life from now on.

A brief explanation of it's assembly:

work top      displays the highest level of a work.
work sub     displays a secondary, lower level work if applicable and present.
part              displays the name of an 'in-between' level of a recording. It could be the 'act', the 'scene', etc.
title piece     displays only the title of the recording, leaving out any related higher level work and part names.

If you want to create your own virtual tags, you'll probably notice that you can use the sub- and superscript numbers in this custom tag to retrieve the specific fields.
The virtual tag examples presented above should give you an idea how to do that.

Six virtual tags
  that will be your main working tools for filtering, displaying, etc.:

Work [top]¨     displays the name of the highest work level. E.g it would display 'Der Ring des Nibelungen, WWV 86'
Work [ sub ]¨   displays the name of the work level just below the top level when present and applicable. (Usually only for more complicated deeper-layered works)
                          Using the previous example it would display 'Götterdämmerung, WWV 86D' since that is a work title one level below the top work level of that release.
                           (Important: read the note about [ sub ] at the bottom of this post)
Work [full]¨       displays both of the above when present.
Work [adapt]¨   displays the name Work [top], or when present, the name of Work [ sub ].
Part¨                  displays the name of an 'in-between' level of a recording. So that could be the name of an act, a scene, a movement, etc.
                           (this is a good candidate to use for sub-grouping)
Title [piece]¨      displays only the recording title excluding work names and part names. If no work or part  levels were detected (i.e. for stand-alone compositions) it will display the full recording title.

An example to clarify what the different 'work' tags would look like:

A couple of additional virtual tags that you may find useful, or use as an example for creating your own virtual tags:

Work + part¨
$IsNull(<Work [adapt]¨>,$IsNull(<Part¨>,,<Part¨>),$IsNull(<Part¨>,<Work [adapt]¨>,<Work [adapt]¨> ≡ <Part¨>))
(displays the work title and part title, useful to use in the Column Browser)

Part + title¨
$IsNull(<Part¨>,$IsNull(<Title [piece]¨>,,<Title [piece]¨>),$IsNull(<Title [piece]¨>,<Part¨>,<Part¨> › <Title [piece]¨>))
(displays the title including parts, excluding work titles)

Title [full]¨
$IsNull(<Work [adapt]¨>,$IsNull(<Part¨>,$IsNull(<Title [piece]¨>,,<Title [piece]¨>),$IsNull(<Title [piece]¨>,<Part¨>,<Part¨>" › "<Title [piece]¨>)),<Work [adapt]¨>$IsNull(<Part¨>,$IsNull(<Title [piece]¨>,," ≡ "<Title [piece]¨>)," ≡ "<Part¨>$IsNull(<Title [piece]¨>,," › "<Title [piece]¨>)))

Some examples of what these tags would look like:

An example how you could use this for the Column browser:

_ _ _ _

Update, I have added another (optional) script:

This one will attempt to create a consistently constructed  'Artist' tag for classical recordings.

The reason for it is that another difference between classical and non-classical music is what can be considered to be 'the artist'  for a recording.
For popular music that's usually simple and unambiguous. E.g. Davis Bowie, Radiohead, etc.

But for classical music,  even aficionados can have long discussions if it should the composer, the conductor, a soloist, the orchestra, all performers, etc.

Picard for example will by default create an artist tag that will not contain the name of the composer.
The 'artist' tag it creates will also require a harder look to see who the performing artist and who the conductor are.

Since I myself prefer to have the name of the composer in the artist tag, and I like to have some indication of 'who is what' I created a script that will look for the presence of composers, conductors  and various 'performers', and then attempts to outputs a consistent tag, without it getting too lengthy.
Brief is good here in my opinion, since more complete and extensive information on orchestra, performers and soloists will (should) be available from the appropriate tags anyway.

Obviously this is a matter of personal preference, and not something that everybody will have the same opinion on.
So before activating this script, first take a good look at the examples and do some tests to see if you like the results.

Some examples:

(on the left Picard's default, on the right the script's output)

The script:

$if(%composersort%%_cwp_composer_lastnames%,$if(%_conductor_sort%,$if(%_cea_album_soloists%%_cea_recording_artist%,$set(artist,$if(%composersort%,$rsearch(%composersort%,^\([^\,]*\)),$rsearch(%_cwp_composer_lastnames%,^\([^\,]*\))) \($rsearch(%_conductor_sort%,^\([^\,]*\))\) ‹ $if(%_cea_album_soloists%,$replace(%_cea_album_soloists%,;, ·),$rsearch(%_cea_recording_artist%,^\([^\,]*\))) ›),$set(artist,$if(%composersort%,$rsearch(%composersort%,^\([^\,]*\)),$rsearch(%_cwp_composer_lastnames%,^\([^\,]*\))) \($rsearch(%_conductor_sort%,^\([^\,]*\))\))),$if(%_cea_album_soloists%%_cea_recording_artist%,$set(artist,$if(%composersort%,$rsearch(%composersort%,^\([^\,]*\)),$rsearch(%_cwp_composer_lastnames%,^\([^\,]*\))) ‹ $if(%_cea_album_soloists%,$replace(%_cea_album_soloists%,;, ·),$rsearch(%_cea_recording_artist%,^\([^\,]*\))) ›),$set(artist,$if(%composersort%,$rsearch(%composersort%,^\([^\,]*\)),$rsearch(%_cwp_composer_lastnames%,^\([^\,]*\)))))),$if(%_conductor_sort%,$if(%_cea_album_soloists%%_cea_recording_artist%,$set(artist,$rsearch(%_conductor_sort%,^\([^\,]*\)) ‹ $if(%_cea_album_soloists%,$replace(%_cea_album_soloists%,;, ·),$rsearch(%_cea_recording_artist%,^\([^\,]*\))) › ),$set(artist,$rsearch(%_conductor_sort%,^\([^\,]*\)))),$if(%_cea_album_soloists%%_cea_recording_artist%,$set(artist,$if(%_cea_album_soloists%,$replace(%_cea_album_soloists%,;, ·),$rsearch(%_cea_recording_artist%,^\([^\,]*\)))),$set(artist,%artist%))))

_ _ _ _

That's pretty much it.
Let me know if you find omissions of any essential steps in this tutorial that made it unnecessary difficult to complete or understand.
(I hate it when that happens to me too ;-)

Some closing remarks:

       This all should not interfere with an existing library containing predominantly non-classical music.
This whole scheme only needs one single custom tag that has no effect whatsoever on your current library.
So this should also help in making it easier to manage a diverse, mixed classical/non-classical music collection.

Tip: For that you could e.g. use virtual tags such as:
Album/Work   :   $If(<Genre Category>="Classical",$IsNull(<Work [adapt]¨>,<Album>,<Work [adapt]¨>),<Album>)

If you are somewhat hesitant and uncertain about all this; a good advice would be to use a separate, portable install of MusicBee, a separate, portable install of Picard, then create a library containing only some copies of your precious music/albums, and then just start messing around and experimenting.

       While the system as described here should make it quite easy to get fast, correct and easy to use results,
please do do understand that classical music will still be quite a b**** to handle and control in pretty much any database system and music playing/managing software.
So I am 101% sure you will encounter releases that will give unsatisfying or unexpected results.
The cause may lie in how they are entered in MusicBrainz' database, or maybe in the way the plugin works, or it could be because of the way my script or my virtual tags are constructed.
Hell, maybe sometime all these three and a full moon combined may be messing things up at the same time. (then just chill and have a cigar)

But in case you find (after having done at least some investigation) that my Picard script or my MusicBee formulae virtuariis are the culprit, or that they can be improved in any way; please let me know‽
You'd help me, and possibly others.

       The screenshots provided are obviously cherry-picked examples that turned out nice.
In reality you will not always get such nice results in all cases, and you will probably need or want to do some additional editing. You can do that either at the stage where Picard loaded the recordings, or after you have imported them into MusicBee's library.
But I think that these scripts will make it a lot easier to get nice and useful results without requiring too much additional effort.

       With this tutorial I tried to describe all steps, with as a starting point having Picard and the CE plugin both at default settings.
I may have overlooked some specific settings that I perhaps did change/remove/added before testing all this, so if you get some very different and unexpected outcomes, let me know, and I will then see if I perhaps overlooked to mention some other required settings.

       Acknowledgements go to MetaTunes, outsidecontext, rdswift, and many others at MusicBrainz.
Without their work and support this would not have been possible.

Good luck, and enjoy!

Important note: the spaces surrounding 'sub' were necessary to prevent this forum from disfiguring this post. If you prefer to remove the spaces, make sure you do that in all tag names and formulas where they occur.
Last Edit: May 28, 2023, 06:03:19 AM by hiccup


  • Hero Member
  • *****
  • Posts: 7998
I made a correction to the script.

The previous version labeled single-level compositions both as a work and as a title, in some places resulting in it's name being displayed twice sequentially, which looked a bit confusing.

Now it shows single-level compositions no longer under 'work'.


  • Jr. Member
  • **
  • Posts: 55
Yeesh. I just leave the song titles as they are, make the composer the album artist, the symphony or orchestra as artists, and the conductor as composer since I wouldn't use conductor for anything else. Then again, I suppose we don't have a massive classical collection, and I'm left unsure what to do with classical compilation albums, but they also tend to not have conductor or symphony information anyways.


  • Hero Member
  • *****
  • Posts: 7998
You are talking about another aspect of handling classical music, namely what you would consider to be an 'artist' in classical music.
That is an interesting and complicated topic by itself, and there are many different opinions and approaches about that.

This topic is specifically about the names of existing work levels and the titles of the sections.

If you only care about 'the title', you would have something like this:

Prelude and Fugue no. 10 in E minor, BWV 879: I. Praeludium

If you use Picard, my script and the virtual tags, you would have this as a full title:

The Well-Tempered Clavier ≡ Book II » Prelude and Fugue no. 10 in E minor, BWV 879 › Prelude {I. Praeludium}

And even better, every section is separately available for filtering, searching and displaying purposes. So:

The Well-Tempered ClavierBook II » Prelude and Fugue no. 10 in E minor, BWV 879Prelude {I. Praeludium}

The start-post is a long-read and may seem complicated at first sight, but the steps to perform are not difficult.
It's only long because I wanted it to be complete in explaining the backgrounds.

If you already use Picard and know how to use virtual tags, you could set it up within 5 minutes.
And after that, from then on it will only take a couple of mouse clicks and maybe some 30 seconds for an album to get these results.


  • Hero Member
  • *****
  • Posts: 3868
My Classical library is very limited, but I'm glad to see that there is a clear and well-detailed procedure for organizing it uniformly and effectively if I ever decide to make that portion of my library less limited.  Thanks for the work you put into this, hiccup.


  • Hero Member
  • *****
  • Posts: 7998
Thanks, and you're welcome frankz.

I understand what you and JZStudios are saying, but wouldn't it be nice to even have a small classical library in perfect shape with displaying works and titles in a correct and pleasant way?

Or maybe your rock-opera's, or jazz-suites, or Porgy and Bess?

(hm, I haven't even tried it out on any of those myself...)


  • Sr. Member
  • ****
  • Posts: 304
Thank you so much, hiccup, for this 'tutorial'.

Sooner or later, I was going to post some related questions to ordering classical music anyway.

I'm kind of postponing doing that...  seems to be so much work...  Guess this is gonna make it a lot easier! :-D
(Up so far, I kind of resorted to a more 'simple' strategy, similar to the one suggested by JZStudios - also fine, for the time being.)

Full installer Version 3_4_7805
Portable Editon 3_4_7805 P
OS: Windows 10 Home Edition


  • Hero Member
  • *****
  • Posts: 7998
For those that are not that much interested in the finer-grained results and extended possibilities that using the script and the virtual tags will make available, but are satisfied to have the standard Title, Work and Movement tags filled properly by Picard and it's Classical Extras plugin:

Install Picard, activate the Classical Extras plugin, navigate to it's Works and Parts settings tab, and set it up something like this:


  • Jr. Member
  • **
  • Posts: 55
I understand what you and JZStudios are saying, but wouldn't it be nice to even have a small classical library in perfect shape with displaying works and titles in a correct and pleasant way?
Mmm, in my case most of the... acts or suites or whatever are the album title, so throwing it in the song title just makes them longer. Otherwise they'e weird compilation albums where it might be useful, but Picard doesn't have them in the database anyways.
I get what you're talking about now and it makes sense but I don't listen to classical music enough or know all the symphonies. And then I'd still have to fiddle with all of the compilations or random symphony albums we got from.... somewhere? With no real information on them. I'm guessing it won't just take "Fur Elise" or "Ode to Joy" and input the symphony info.
It might help "organize" this in various artists though.

Frankly I'm more interested in getting the artist, composer, and conductor information in a quicker way than searching for the album on Discogs and manually transferring them over. Thankfully I don't have a large classical collection so I've already done it.


  • Hero Member
  • *****
  • Posts: 7998
Updated, revised, improved.

While the previous version performed as expected, the part where it's ambition was to also separate 'inter part' levels (e.g. to separate 'act'  from 'scene'), that proved to be not that useful, and worse; on a regular bases resulting in flaws such as e.g. duplicate naming and  empty fields. Likely a consequence of the not always consistent way the hard working editors have entered the content in MusicBrainz' database.
(yes, it's some hard monk's work going on over there by a lot of volunteers making this even possible)

So I decided to remove the mechanism that tried to refine- and make a distinction between multiple in-between parts.

Also I have been running a larger variety of classical works by the script than the genres/composition-types that I usually listen to.
E.g. I have tested and tweaked it better for Opera, a genre I am not that familiar with.
(nobody better touch my Dido though!)

The script and the virtual tags are now tweaked and tuned to give the best possible results in creating labels for:

- Work (top)        The top-level name of a work.     (e.g.: "Der Ring des Nibelungen, WWV 86", or "Trionfi")
- Work (sub)        Only when applicable: the second-level work name. (e.g.: "Götterdämmerung, WWV 86D", or "Carmina Burana")
- Part                     The in-between level(s) between a higher level 'work' and a lower level 'title'.  (e.g. "Scene 1", "Act. II", etc.)
- Title (piece)       The title of the track/recording. This should always be populated by the script; if the recording is part of a multi-level work or movement it should contain only the title level. (and only anything that is not already displayed by 'work' and/or 'part')  If it is a single-level stand-alone work/composition, it should show it's full title.

To summarise:

- The previous Picard script and the previous virtual tags for MusicBee were removed and replaced by new versions.
- The text of the tutorial was revised completely.
- The explanatory screenshots were updated.

Oh, and I added a new script to cover this:

You are talking about another aspect of handling classical music, namely what you would consider to be an 'artist' in classical music.
That is an interesting and complicated topic by itself, and there are many different opinions and approaches about that.
Last Edit: March 04, 2020, 09:15:39 PM by hiccup


  • Hero Member
  • *****
  • Posts: 7998
This is not so much an update to the original post, the scripts or the formulas, but a reminder to be sure to use a recent version of Picard.

Using Picard versions earlier than 2.3.2 can result in incorrect indications of 'scenes' or 'acts' when using my script.
The cause of this has been addressed in the recently released 2.3.2 version of Picard, so be sure to upgrade to at least that version if you are using my script/workflow.


  • Jr. Member
  • **
  • Posts: 65
Hey hiccup, if its not too much to ask, could you please elaborate your display settings and grouping to achieve the look in the first image?

For the most part I can make out what's being outlined; getting the same output would make me more confident I'm getting it.


  • Jr. Member
  • **
  • Posts: 65

Here's what I've managed to do so far.

I can't recreate what you did in box 1. You seem to be using a virtual tag not listed in the OP. No clue how you included clef sign, etc.

[Edit] I solved the sub grouping. I need to use the "Part¨" tag.  I suppose now that I've figured it out, why did you choose to leave out the opus number for "..."?

Featured artists and Ensemble, other tags not enumerated in OP.
Last Edit: May 25, 2020, 01:11:13 PM by please55


  • Hero Member
  • *****
  • Posts: 7998
I can't recreate what you did in box 1. You seem to be using a virtual tag not listed in the OP. No clue how you included clef sign or person symbol.
You are grouping the tracks seemingly around the composition/work name.  I can't figure out which virtual tag it is. The closest one provided by Musicbrainz includes the movement name - so I imagine there's a script working here.
Featured artists and Ensemble, yet another tag not enumerated here.

Thank you for giving it a good kick against the tires, and for the feedback!

My apologies for making this all a bit of a 'welcome in hell' experience ;-)

Yes you are right, I have some other virtual tags working here too.
Just sharing them here would not be helpful to anyone, since they also depend on other virtual and custom tags and on a certain workflow.
Just copy and pasting them in any other setup would create havoc and probably make other users pulling out their hairs.

I am currently a bit occupied doing to many things at the same time, but I'll see if I can reply with some useful things concerning the symbols and perhaps other stuff this week.

Stay sane ;-)


  • Jr. Member
  • **
  • Posts: 65
Absolutely, please take your time. I'll keep at it on my end. Caveat, I'm am new to Classical music in general and their naming conventions etc.