Author Topic: A Picard script for MusicBee compatible Tag Mappings  (Read 375 times)

hiccup

  • Sr. Member
  • ****
  • Posts: 7936
 
When using 3rd party tagging software such as Picard, Mp3tag, etc. it can be a challenge to get these programs to write all tags in the same way as how a music player/manager such as MusicBee expects and requires them to be.

E.g. a tag such as 'record label' knows variations such as:

- label
- publisher
- organization

It will depend on the software and the audio format what is used.
And when the tagging software writes them in a way that MusicBee does not expect, these tags will simply not show up.


For Picard you can use scripting to make such necesary adjustments, called 'tag mapping'.
To make things easier for beginning Picard users I have concocted such a script.

It will map all the tags that Picard would write differently from how MusicBee expects them, to be fully compatibe with MusicBee.

This does not pretend to be the only, nor the best, nor a complete solution.
It's intended as an easy way for users who want to start using Picard, without the need to learn how to script first to get some basic, good results with MusicBee.
The script may also be helpful to more advanced Picard users that can use it to tweak and expand things to their own preferences.


- - -


HowTo:


- copy the script:

Code
$noop(
tag mapping for flac, opus, ape)

$if($eq_any(%_extension%,flac,opus,ape),$set(initialkey,%key%),)
$if($eq_any(%_extension%,flac,opus,ape),$unset(key))
$if($eq_any(%_extension%,flac,opus),$set(organization,%label%),)
$if($eq(%_extension%,ape),$set(publisher,%label%),)
$if($eq_any(%_extension%,flac,opus,ape),$unset(label),)
$if($eq_any(%_extension%,flac,opus,ape),$set(mixartist,%remixer%),)
$if($eq_any(%_extension%,flac,opus,ape),$unset(remixer))
$if($eq_any(%_extension%,flac,opus),$set(source medium,%media%),)
$if($eq(%_extension%,ape),$set(mediatype,%media%),))
$if($eq_any(%_extension%,flac,opus,ape),$unset(media),))
$if($eq_any(%_extension%,flac,opus,ape),$set(setsubtitle,%discsubtitle%),)
$if($eq_any(%_extension%,flac,opus,ape),$unset(discsubtitle))
$if($eq_any(%_extension%,flac,opus,ape),$set(origyear,%originaldate%),)
$if($eq_any(%_extension%,flac,opus,ape),$unset(originaldate))
$unset(originalyear)


$noop(
Artist, Composer, Display artist, Display composer)

$set(display artist,%artist%)
$set(artist,%artists%)
$copymerge(composer,writer)
$set(display composer,$replace(%composer%,;,\,))


$noop(
create 'Involved People List' for flac, opus, ape)

$if(%arranger%,$setmulti(_arranger,arranger: %arranger%),)
$setmulti(_arranger,$replace(%_arranger%,;,; arranger:))
$if(%djmixer%,$setmulti(_djmixer,DJ-mix: %djmixer%),)
$setmulti(_djmixer,$replace(%_djmixer%,;,; DJ-mix:))
$if(%mixer%,$setmulti(_mixer,mix: %mixer%),)
$setmulti(_mixer,$replace(%_mixer%,;,; mix:))
$if(%engineer%,$setmulti(_engineer,engineer: %engineer%),)
$setmulti(_engineer,$replace(%_engineer%,;,; engineer:))
$if(%producer%,$setmulti(_producer,producer: %producer%),)
$setmulti(_producer,$replace(%_producer%,;,; producer:))
$copymerge(involvedpeople,_arranger)
$copymerge(involvedpeople,_djmixer)
$copymerge(involvedpeople,_mixer)
$copymerge(involvedpeople,_engineer)
$copymerge(involvedpeople,_producer)
$if($eq(%_extension%,mp3),$unset(involvedpeople))


- install it in Picard like this:

 


- make sure you that have 'Use release relationships' and  'Use track relationships' checked.


- - -


what the script does:


Picard
MusicBee equivalent
for mp3 only
script function:
ArtistArtistwrites a multi-value Artist tag
writes a single-value Display Artist tag
Arranger      -gets written to Involved People Listwrites Arranger: to Involved People List for FLAC, OPUS and APE
ComposerComposerjoins Composer and Writer into Composer (multi-value)
joins Composer and Writer into Display Composer (single-value)
Writer      -joins Composer and Writer into Composer (multi-value)
joins Composer and Writer into Display Composer (single-value)
Mix-DJ      -gets written to Involved People Listwrites DJ-mix: to Involved People List for FLAC, OPUS and APE
RemixerMix Artist
(activate custom tag)
Artist: Remixermaps the tag properly to Mix Artist (1)
Mixer      -gets written to Involved People Listwrites Mix: to Involved People List for FLAC, OPUS and APE
Engineer      -gets written to Involved People Listwrites Engineer: to Involved People List for FLAC, OPUS and APE
Producer      -gets written to Involved People Listwrites Producer: to Involved People List for FLAC, OPUS and APE
Original Release DateOriginal Yearmaps to Original Year (yyyy-mm-dd)
Disc SubtitleSet Subtitle
(activate custom tag)
maps the tag properly to Set Subtitle (1)
Initial KeyInitial Key
(activate custom tag)
maps the tag properly to Initial Key (1) (2)
Record LabelPublishermaps the tag properly to Publisher
MediaMedia Type
(activate custom tag)
maps the tag properly to Media Type (1)

(1)  to have it available in MusicBee you need to set/activate the custom tag for it
(2)  requires activating Picard's 'AcousticBrainz Tonal-Rhythm' plugin (which sets both the Initial Key and BPM)


note:

The script works for flac, mp3, opus and ape audio formats.
I've not checked or adjusted it for any other types. (nor do I intend to)



IMPORTANT

Make sure that you first do some thorough testing of the script on copies of files from your actual library.
Picard is a powerful tool, and you should make sure that things are working as you expect before letting it loose on your actual library.
 
Last Edit: May 05, 2024, 08:36:53 AM by hiccup

hiccup

  • Sr. Member
  • ****
  • Posts: 7936
 
And a script that will create proper Album artist and Album artists tags.


This script requires that:


1.

The Additional Artists Variables plugin is installed:



2.

A custom tag for Album artists is setup in MusicBee:






The script:

Code
$set(albumartist,$replace(%_artists_album_all_cred%,;,\,)))

$setmulti(_albumartist,%albumartist%)
$setmulti(_albumartists,%_albumartists%)
$setmulti(_artists_album_primary_cred,%_artists_album_primary_cred%)
$setmulti(_artists_album_additional_cred,%_artists_album_additional_cred%)
$setmulti(_artists_album_all_cred,%_artists_album_all_cred%)

$copymerge(_albumartists_merged,_albumartist)
$copymerge(_albumartists_merged,_albumartists)
$copymerge(_albumartists_merged,_artists_album_primary_cred)
$copymerge(_albumartists_merged,_artists_album_additional_cred)
$copymerge(_albumartists_merged,_artists_album_all_cred)

$setmulti(albumartists,%_albumartists_merged%)


should look like this:




Some examples of results:

('Original Value' is stock Picard, 'New Value' is what the script produces)







(note that the output will depend on if you have 'Use standardized artist names' checked or unchecked)
 
Last Edit: May 05, 2024, 06:13:30 PM by hiccup

Odio

  • Newbie
  • *
  • Posts: 5
I had actually been looking to get a script that does this, so it's good you made one because my own attempts at scripting had been... questionable

ewan

  • Newbie
  • *
  • Posts: 4
$copymerge(composer,writer)
In my opinion, writer is not really composer, since a writer can be involved in writing the text, not just the instrumental. It might also be worth copying into lyricist tag.

Code
$noop(
create 'Involved People List' for flac, opus, ape)

$if(%arranger%,$setmulti(_arranger,arranger: %arranger%),)
$setmulti(_arranger,$replace(%_arranger%,;,; arranger:))
$if(%djmixer%,$setmulti(_djmixer,DJ-mix: %djmixer%),)
$setmulti(_djmixer,$replace(%_djmixer%,;,; DJ-mix:))
$if(%mixer%,$setmulti(_mixer,mix: %mixer%),)
$setmulti(_mixer,$replace(%_mixer%,;,; mix:))
$if(%engineer%,$setmulti(_engineer,engineer: %engineer%),)
$setmulti(_engineer,$replace(%_engineer%,;,; engineer:))
$if(%producer%,$setmulti(_producer,producer: %producer%),)
$setmulti(_producer,$replace(%_producer%,;,; producer:))
$copymerge(involvedpeople,_arranger)
$copymerge(involvedpeople,_djmixer)
$copymerge(involvedpeople,_mixer)
$copymerge(involvedpeople,_engineer)
$copymerge(involvedpeople,_producer)
$if($eq(%_extension%,mp3),$unset(involvedpeople))
It's great! I'm taking it for eternal use.

hiccup

  • Sr. Member
  • ****
  • Posts: 7936
…In my opinion, writer is not really composer, since a writer can be involved in writing the text, not just the instrumental. It might also be worth copying into lyricist tag.…

…It's great! I'm taking it for eternal use…
Great to hear!

There is truth in what you say about lyricist, writer, etc., but this script is intended to provide basic tag mapping for tags that would otherwise be invisible in MusicBee.

The 'Lyrics' tag does not need mapping since MusicBee will display it out-of-the-box when Picard has retrieved and written it.

Even though a bit vague, 'Writer' is a valuable piece of information, and by writer, MusicBrainz doesn't mean writer as in 'writing lyrics'.
Nor as in 'writing the sheet music'.

For a lot of songs by bands it is either not documented which band member did only the composition, or which one did only the lyrics, or if it was some  joint effort where everybody contributed something, and nobody can claim the single role of composer, lyricist, arranger, etc.

For such cases MusicBrainz (Picard) will use 'Writer', since 'Composer' or 'Lyricist' would not be appropriate.

So for this basic script 'Writer' needed to be merged with either Composer or Lyricist so that valuable information would not get lost.
To me it made most sense to merge it with 'composer'. (at least for non-classical music)
But it should be easy for anyone to change that.

Anyone is obviously free to use the script as a bases and expand and enhance it to some more fine-grained level.
Or for users that have done so, publish their versions in this topic. (as long as some good explanation on what possible adjustments in MusicBee need to be made to make their script work.
 
Also, this all mostly covers 'popular' music.
Classical music is a completely different beast, and that will definitely need more complicated scripts. (and Picard plugins if you want to do it right)
Last Edit: May 05, 2024, 08:28:14 PM by hiccup

hiccup

  • Sr. Member
  • ****
  • Posts: 7936
I have added a script that produces proper Album artist and Album artists tags.
(see post #2)

Dizza17

  • Jr. Member
  • **
  • Posts: 75
Hi Hiccup,
Thank you so very much for the awesome scripts. I have tweaked the involved people list to my personal liking, but I’m not entirely sure I’ve got it right. Let me know if there’s something I’ve missed. Thanks again!!

$noop(
create 'Involved People List' for flac, opus, ape)

$if(%arranger%,$setmulti(_arranger,arranged By: %arranger%),)
$setmulti(_arranger,$replace(%_arranger%,;,; Arranged By:))
$if(%djmixer%,$setmulti(_djmixer,DJ-mixed By: %djmixer%),)
$setmulti(_djmixer,$replace(%_djmixer%,;,; DJ-mixed By:))
$if(%mixer%,$setmulti(_mixer,mixed By: %mixer%),)
$setmulti(_mixer,$replace(%_mixer%,;,; Mixed By:))
$if(%engineer%,$setmulti(_engineer,engineered By: %engineer%),)
$setmulti(_engineer,$replace(%_engineer%,;,; Engineered By:))
$if(%producer%,$setmulti(_producer,produced By: %producer%),)
$setmulti(_producer,$replace(%_producer%,;,; Produced by:))
$if(%writer%,$setmulti(_writer,Written By: %writer%),)
$setmulti(_writer,$replace(%_writer%,;,; Written By:))

$copymerge(involvedpeople,_arranger)
$copymerge(involvedpeople,_djmixer)
$copymerge(involvedpeople,_mixer)
$copymerge(involvedpeople,_engineer)
$copymerge(involvedpeople,_producer)
$copymerge(involvedpeople,_writer)
$if($eq(%_extension%,mp3),$unset(involvedpeople))
When the rich wage war, it’s the poor who suffer.

hiccup

  • Sr. Member
  • ****
  • Posts: 7936
I have tweaked the involved people list to my personal liking, but I’m not entirely sure I’ve got it right. Let me know if there’s something I’ve missed.

$noop(
create 'Involved People List' for flac, opus, ape)
...
I am guessing that is only a part of the script you are using?
It's best to post the complete script, so others may use it and/or test it.
And post it as code, not as text. (use the </> button in the post edit panel)

Does 'Written by' show for your MP3 files? (using the Involved People tag)
It probably won't be a problem for FLAC/OPUS, but it may fall outside the specs of ID3v2.
If it doesn't show, you will need to create a custom tag for Writer.


edit/update

After some testing, I can't get this added 'writer' tag to show in the Involved People List for MP3's.
(not a problem for FLAC/OPUS though)
And it seems to me that the limitation is not in ID3v2, and also not in MusicBee.

I have the impression that the restriction/issue seems to be with Picard, in that it refuses to write anything else than 'the usual suspects' to TIPL.

You (or anyone else interested in getting this to work) could raise this on MusicBrainz' Picard forum.
It could be nice to have this working.
Last Edit: May 08, 2024, 07:40:47 PM by hiccup