Classical Composer Scripting Advice

picard
classical
scripting
composer
Tags: #<Tag:0x00007f3097d24028> #<Tag:0x00007f3097d2be18> #<Tag:0x00007f3097d2bbe8> #<Tag:0x00007f3097d2ba08>

#1

Hello all,

I’m a noob at scripting, but I was wondering if anyone could help me come up with a script regarding classical music. I’m trying to batch rename the metadata of a set of tracks so the existing title is prefixed with the composer’s last name, followed by a colon and a space, as in:

Composer’sLastName: ExistingPieceName

For example, say the original metadata title was something like this:

Hungarian Rhapsody No. 2 in C sharp minor

With the composer of the work being Franz Liszt, the idea is to append his last name in front of the existing title, if the original title didn’t include it:

Liszt: Hungarian Rhapsody No. 2 in C sharp minor

I’ve thought of some pseudocode to potentially implement this:

If composer’s last name is not already present in the title,
Then append composer’s last name before title, followed by a colon and a space.

If anyone might know a way to translate this to a script, I’d really appreciate it! I have many thousands of classical tracks in my digital library, and most of them exclude the composer’s name from the title, which makes it hard to determine the composer of the piece when skimming through the titles.

Thank you so much in advance!

~David~


#2

I suggest you have a look at the Classical Extras plugin. Which version of Picard are you using?


#3

I had checked the Classical Extras plugin, but it seemed to only offer the option of adding the composer’s name before the album name, not before each track (unless I missed it).

I’m running Picard Version 2.0.3.

Thanks again!


#4

There are “hidden variables” for composer last names which can be applied in the tag mapping section. However, on review, I see that the “track composer” only works if the composer is also named as an album artist - I’ll do a tweak to add another variable.
It is probably also possible to do it using Tagger Scripts - maybe someone else can suggest how?
When you talk about “skimming through the titles”, what software are you using? Any decent music library manager ought to be able to arrange titles by composer.


#5

I’ll take a look into the tag mapping section… sounds promising!

I have a modified large-capacity iPod Classic into which I’m loading my collection of mostly classical music. When scrolling through the list of titles, it’s great to see the composer name as a prefix to the track title, since I’m dealing with a somewhat primitive GUI on a small 2.5" display. I’ve been tagging most of my classical music manually in iTunes, spending countless hours copying and pasting the composer’s last name in front of the title, but I haven’t yet come across a way to streamline the process. Now, with the combination of scripts/plugins and Picard, I see a glimmer of hope! :slight_smile:


#6

New version of Classical Extras at https://github.com/MetaTunes/picard-plugins/releases/tag/2.0.1
To put composer last names at start of title, followed by colon:
On the second tab (tag mapping), enter ‘title’ (no quotes) in the ‘tags to blank’ section. Then create a tag mapping line with

composer_lastnames + \: + title, title

as the source (space after : is important) and

title 

as the destination, with ‘conditional’ selected.
That way, if there is no composer, it will just put the title back in (as it was blanked initially).


#7

After dabbling around with the settings, I managed to get it to work, and am incredibly thankful for your help! All the titles are indeed prefixed by the composer’s last name, and it all seems to work like a charm! I can’t express my gratitude enough!

The only odd thing is that Picard keeps crashing after processing a couple hundred tracks using the “Scan” button, but I’m guessing that’s another problem for another thread…

Edit: The program didn’t crash after I disabled the Classical Extras plugin, and I was able to normally process the same files that had otherwise caused the program to crash with the plugin enabled… looks like it might be some sort of hidden bug? I’ll try another approach to go around this issue-- I’ll run the problematic audio files through lookup and scan, with Classical Extras disabled, and then I’ll enable the plugin on the modified files to see if the issue will be resolved.