How do i add titlesort, composer, composersort to tag and with value

Greetings,

I’m at a loss for something simple.
How do I add titlesort, composer, composersort and writersort to tag?
Where can I find examples of making scripts?

Thanks

If you tag your files with Picard against release and recording data loaded from MusicBrainz composer and composersort will be set automatically by Picard.

Picard does support a titlesort tag, but it does not get filled by Picard as there is no support for setting a separate sort title for recordings in MB. You can set it using scripting, depending on what you actually want. If all you want is moving leading “The” to the end (e.g. for the song “The Memory Remains” use “Memory Remains, The” as titlesort) then this script in Options > Scripting can work:

$set(titlesort,$swapprefix(%title%))

Picard has no support for a tag called writersort and hence does not know how to write this to specific tag formats. But you could set such a tag with scripting and it would be saved as a custom tag “writersort” to the files (if the format supports this). You could also use $swapprefix, but as the writer tag is a multi-value variable and there might be multiple writers it becomes a bit more complicated. I think this should work (untested):

$setmulti(writersort,%writer%)
$map(%writersort%,$swapprefix(%_loop_value%))
2 Likes

Hello,

Thanks so much for all the useful information and scripts.
I wouldn’t have been able to figure the scripts out.

It looks like I need to take some time and learn more about scripting.

Have a great day!!

| outsidecontext
December 30 |

  • | - |

If you tag your files with Picard against release and recording data loaded from MusicBrainz composer and composersort will be set automatically by Picard.

Picard does support a titlesort tag, but it does not get filled by Picard as there is no support for setting a separate sort title for recordings in MB. You can set it using scripting, depending on what you actually want. If all you want is moving leading “The” to the end (e.g. for the song “The Memory Remains” use “Memory Remains, The” as titlesort) then this script in Options > Scripting can work:

$set(titlesort,$swapprefix(%title%))

Picard has no support for a tag called writersort and hence does not know how to write this to specific tag formats. But you could set such a tag with scripting and it would be saved as a custom tag “writersort” to the files (if the format supports this). You could also use $swapprefix, but as the writer tag is a multi-value variable and there might be multiple writers it becomes a bit more complicated. I think this should work (untested):

$setmulti(writersort,%writer%)
$map(%writersort%,$swapprefix(%_loop_value%))

1 Like

Hello,

Thanks for your help.
The titlesort worked but the writersort didn’t.

I’m satisfied with just the titlesort.

Best Wishes!!

1 Like

Yeah, the writersort script was kind of a thinking error on my side. The script kind of works, it just doesn’t do what you need :slight_smile: As it is only using $swapprefix it would turn “The Beatles” into “Beatles, The”. But writers usually are persons and you want it turned into “Last name, first name” style.

There is not scripting function for that. So this functionality would require a plugin to work.

There are two ways the plugin could handle this:

  1. It could load the actual sort name for the writer from MusicBrainz. I think this could require an additional web service request per artist, but I would need to check.
  2. The plugin could also try to guess the sortname by just attempting to switch “Firstname Lastname” into “Lastname, Firstname”. This is not perfect, but works in many cases

Anyway, we could also consider to add this functionality directly into Picard. I added a ticket to investigate this: [PICARD-2606] Add writer sort names - MetaBrainz JIRA

1 Like

Thanks. again!

I’m now following this ticket along with the ticket for another issue (unrelated)

Al

I’ve already written a plugin to do that as I personally wanted to have accompanying *sort tags for writer and lyricist too:

It does not require an additional API request, the data is already there and is made available as a hidden multi-value variable by my plugin.

I think I’ve already mentioned the plugin in the forums a few years ago, but there was not much interest and so I did not submit it to be included in the official plugin list. If there’s interest, I could do that now or directly integrate it into Picard. Two additional (hidden) variables _writersort and _lyricistsort would cause no harm, I guess :slight_smile:

2 Likes

I haven’t downloaded a py plugin for awhile and am unable to locate the download so i can install the plugin

You can install the plugin by putting the Python file directly into Picard’s plugin folder. Simply go the “Plugins” page in the Picard options and click the “Open plugin folder” button. Or you can store the Python file anywhere on your computer and select it after clicking the “Install plugin…” button next to the other button.

1 Like

This may be an additional bug with 2.9.0a1 since I’ve been trying this from last night and again this morning with not being able for this to install it.
I just followed your instructions and it still won’t install.

I’m going to try to go back to 2.8.5 and try to install it from there.

I agree. Would appreciate a pull request for this very much :slight_smile:

1 Like

Sure, I’ll look into it tomorrow. You’re talking about directly integrating it into Picard, right? (Just asking because I also talked about submitting a PR for the plugin in the same sentence.)

1 Like

Hello,

Thanks, no need to look at it tomorrow.
It’s another bug with 2.9.0a1

I went back to 2.8.5 and your plug-in installed and is working with no issues.

Thanks again for your help and your work.

Al

Oh yes, directly into Picard is what I meant