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

**URL:** <https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479>\
**Category:** MusicBrainz Picard\
**Created:** [September 26, 2018, 4:42pm UTC](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479 "2018-09-26T16:42:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiccup](https://community.metabrainz.org/user_avatar/community.metabrainz.org/hiccup/32/5512_2.png) [@hiccup](https://community.metabrainz.org/u/hiccup)\
**Post date:** [September 26, 2018, 4:42pm UTC](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479/1 "2018-09-26T16:42:39Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![IvanDobsky](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ivandobsky/32/11785_2.png) [@IvanDobsky](https://community.metabrainz.org/u/IvanDobsky)\
**Post date:** [January 4, 2019, 3:49pm UTC](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479/2 "2019-01-04T15:49:54Z")

</div>

> [@hiccup](#):
>
> If you are not using the Standardise Performer plugin, this script may not give good or satisfactory results.

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.

---

<div class="post-metadata">

**Author:** ![rdswift](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rdswift/32/7032_2.png) [@rdswift](https://community.metabrainz.org/u/rdswift)\
**Post date:** [January 4, 2019, 7:09pm UTC](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479/3 "2019-01-04T19:09:58Z")

</div>

You might be able to make use of the [Performer Tag Replace](https://github.com/rdswift/picard-plugins/blob/2.0_RDS_Plugins/plugins/performer_tag_replace/docs/README.md) 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/](https://picard.musicbrainz.org/plugins/) for more information.

---

<div class="post-metadata">

**Author:** ![hiccup](https://community.metabrainz.org/user_avatar/community.metabrainz.org/hiccup/32/5512_2.png) [@hiccup](https://community.metabrainz.org/u/hiccup)\
**Post date:** [January 9, 2019, 7:05pm UTC](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479/4 "2019-01-09T19:05:53Z")

</div>

> [@IvanDobsky](#):
>
> Is there a way of tweaking this script to drop all the current instruments in a file before replacing them?

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

---

<div class="post-metadata">

**Author:** ![IvanDobsky](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ivandobsky/32/11785_2.png) [@IvanDobsky](https://community.metabrainz.org/u/IvanDobsky)\
**Post date:** [January 10, 2019, 7:53pm UTC](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479/5 "2019-01-10T19:53:20Z")

</div>

> [@hiccup](#):
>
> Has rdwift’s plugin solved your question/issue?  
> I’ve abandoned this script myself and replaced it with the plugin.

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.

---

<div class="post-metadata">

**Author:** ![rdswift](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rdswift/32/7032_2.png) [@rdswift](https://community.metabrainz.org/u/rdswift)\
**Post date:** [January 10, 2019, 9:12pm UTC](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479/6 "2019-01-10T21:12:40Z")

</div>

> [@IvanDobsky](#):
>
> Plugins are even scarier for me due to the limited documentation.

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

* * *

# Performer Tag Replace [[Download](https://picard.musicbrainz.org/api/v2/download?id=format_performer_tags)]

## 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:

```auto
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:

```auto
==========================================
= 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:

```auto
==================================
= 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:

```auto
=====================================
= 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`.

* * *
