A script to correct 'membranophones' and guitar/violin 'families'

I updated my script. (and created this dedicated topic for it)

What it does:

  • When it encounters occurences of ‘membranophones’, it will change them to ‘drums’.
  • When it encounters occurences of instrument ‘families’, it will change them to a plural version of these instruments.

It will not delete any tags from your existing files.

I believe this script can be useful until the moment that all existing ‘membranophones’ and ‘families’ entries are removed from MusicBrainz’s library.

A previous version of my script missed some ‘additional’ and ‘guest’ occurences, and if a recording contained more than one “membranophonist” (be it guest, additional, etc.), I think it would only write one of them.
(sorry about that)

Here is a new version that will change:

  • “membranophone” and “drums (drumset)” to: “drums”
  • “additional membranophone” to: “additional drums”
  • “guest membranophone” and “guest drums (drumset)” to: “guest drums”
  • “additional guest membranophone” to: “additional guest drums”
  • “guitar family” to: “guitars”
  • “guest guitar family” to: “guest guitars”
  • “additional guitar family” to: “additional guitars”
  • “additional guest guitar family” to: “additional guest guitars”
  • “guitar family and solo” to: “guitars and solo”
  • “violin family” to: “violins”

This is of course setup to some personal preferences, so feel free to use/edit/publish it any way you want.

.
Important note:
This script is giving me exactly the output and the results that I need for my music player/manager, in combination with using the Standardize Performer plugin for Picard.

If you are not using the Standardise Performer plugin, this script may not give good or satisfactory results.

Also in this case, feel free to change or publish it to accomodate for your own user case.

.
the script:

$setmulti(performer:drums,$get(performer:membranophone); $get(performer:drums (drum set)))
$setmulti(performer:additional drums,$get(performer:additional membranophone))
$setmulti(performer:guest drums,$get(performer:guest membranophone); $get(performer:guest drums (drum set)))
$setmulti(performer:additional guest drums,$get(performer:additional guest membranophone)))
$set(performer:guitars,$get(performer:guitar family))
$set(performer:guest guitars,$get(performer:guest guitar family))
$setmulti(performer:additional guitars,$get(performer:additional guitar family)))
$setmulti(performer:additional guest guitars,$get(performer:additional guest guitar family)))
$set(performer:guitars and solo,$get(performer:guitar family and solo))
$set(performer:violins,$get(performer:violin family))
$unset(performer:membranophone)
$unset(performer:drums (drum set))
$unset(performer:additional membranophone)
$unset(performer:guest membranophone)
$unset(performer:guest drums (drum set))
$unset(performer:additional guest membranophone))
$unset(performer:guitar family)
$unset(performer:guest guitar family)
$unset(performer:additional guitar family)
$unset(performer:additional guest guitar family))
$unset(performer:guitar family and solo)
$unset(performer:violin family)

3 Likes

Is there a way of tweaking this script to drop all the current instruments in a file before replacing them?

Some kind of $unset(performer:*) wildcard thing to strip all instruments out before putting them back in.

My problem with trying to run this is most of my files are currently tagged without the “standardise performer” plugin. So if I now enable this, and run Picard, it will ADD more instruments on top.

Yeah - I could use the “delete all the tags” options but there are other tags I want to preserve.

1 Like

You might be able to make use of the Performer Tag Replace plugin for this. It’s something that I threw together a few months ago, but haven’t yet submitted it to the official plugins list. I haven’t tested it on existing tags, so I’m not sure it will do what you want. If you do decide to try it, please test with a copy of your current files, and let me know whether or not it works with existing tags. Thanks.

EDIT: This plugin is now included in the “official” plugin list included with Picard. See https://picard.musicbrainz.org/plugins/ for more information.

2 Likes

Has rdwift’s plugin solved your question/issue?
I’ve abandoned this script myself and replaced it with the plugin.

2 Likes

Sorry, time means I haven’t looked close enough at this. MB Scripts are still very new to me so I have to have the right head on that day to work out if I am doing everything right.

Plugins are even scarier for me due to the limited documentation.

I’ll report back with my results once I get the time to try this out properlly.

Here’s the documentation for the Performer Tag Replace plugin:


Performer Tag Replace [Download]

Overview

This plugin provides the ability to replace text in performer tags. Once installed a settings page will be
added to Picard’s options, which is where the plugin is configured.


Settings

The settings panel allows the user to provide a list of the original/replacement pairs used to modify the keys
for the performer tags. Each pair must be entered on a separate line in the form:

original character string=replacement character string

Blank lines and lines beginning with an equals sign (=) will be ignored. Replacements will be made in the
order they are found in the list.

There is also a setting which allows the user to choose whether or not to apply the replacements to the artist
values in addition to the instrument / vocal keys. By default, only the keys are processed.


Examples

Example 1:

Suppose that you don’t like instruments listed as “instrument family”, but would rather have it shown as
the plural of the instrument. This could be done using the following:

==========================================
= Remove "family" from instrument groups =
==========================================
s family=ses
 family=s

Note that the last line begins with a single space.

This would cause the performer credit Performer [guitar family]: Chet Atkins to be changed to Performer [guitars]: Chet Atkins.

Note that the s family=ses would match an instrument family where the instrument ended in “s” and add
“es” rather than just an “s”. For example if there was a “bass family”, this would change it to “basses”
rather than “basss”. (As of this writing, I don’t think there are any cases in the database where the
instrument in an instrument family ends with an “s”, so that replacement pair should never be triggered.)

Example 2:

Suppose that you don’t like the term “additional”, but would rather have it shown as “extra”. This could
be done using the following:

==================================
= Change "additional" to "extra" =
==================================
additional=extra

This would cause the performer credit Performer [additional background vocals]: Jeen to be
changed to Performer [extra background vocals]: Jeen.

Example 3:

Suppose that you want to show the instrument as “drums” rather than “drums (drum set)”, or “membranophone”.
This could be done using the following:

=====================================
= Standardize instrument to "drums" =
=====================================
drums (drum set)=drums
drum set=drums
membranophone=drums

This would cause the performer credit Performer [membranophone]: Ringo Starr to be changed to
Performer [drums]: Ringo Starr.


2 Likes