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:
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!
I suggest you have a look at the Classical Extras plugin. Which version of Picard are you using?
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.
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.
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!
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
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).
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.
Hi I wanted to add to the end of title the Orchestra, using the line posted here I did this:
composer_lastname + \: + title, + \ § '+ band +\', title
It worked like this:
Before: Bartók: Piano Concerto no. 1: I. Allegro Moderato
After: Bartók: Piano Concerto no. 1: I. Allegro Moderato § 'Deutsches Symphonie-Orchester Berlin’
But when “band” it’s empty it doesn’t work at all, how can I fix it? Thanks in advance the plug in it’s great.
Edit: I don’t know if it’s relevant but the tag is in a .flac archive. Would be different with an ID3 TAG?
Well, I couldn’t solve this yet by myself, so, a little help will be welcome.
I walk around the problem, putting the “band” in the tag map, so it’s routing to the “artist”, but it’s not ideal for other several problem.
If someone could help to fix this, and make the “band” or “ensemble” name to te end of the title like the example I put in my preview post, it would be great.
Thanks in advance.