# Picard script for handling instrument families and more

**URL:** <https://community.metabrainz.org/t/picard-script-for-handling-instrument-families-and-more/400010>\
**Category:** MusicBrainz Picard\
**Created:** [September 15, 2018, 7:18am UTC](https://community.metabrainz.org/t/picard-script-for-handling-instrument-families-and-more/400010 "2018-09-15T07:18:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 15, 2018, 11:20pm UTC](https://community.metabrainz.org/t/picard-script-for-handling-instrument-families-and-more/400010/3 "2018-09-15T23:20:04Z")

</div>

> [@Drums vs. drumset](https://community.metabrainz.org/t/drums-vs-drumset/194166/141):
>
> I would also like to have the script catch instances of both “membranophone” and “drums (drumset)”, and write either of them to “drums”, but I haven’t succeeded yet in getting them to work together.

I might have succeeded in combining these. (and I added some ‘guest membranophone’ I encountered that wasn’t a guest at all)

This seems to work nicely for now:

```
$set(performer:drums,$if2(%performer:membranophone%,$get(performer:drums \(drum set\)),$get(performer:guest membranophone),$get(performer:additional membranophone)))
$unset(performer:membranophone)
$unset(performer:drums \(drum set\))
$unset(performer:guest membranophone)
$unset(performer:additional membranophone)
$set(performer:guitars,$get(performer:guitar family))
$unset(performer:guitar family)
$set(performer:guitars and solo,$get(performer:guitar family and solo))
$unset(performer:guitar family and solo)
$set(performer:violins,$get(performer:violin family))
$unset(performer:violin family)

```

I am not very versed in Picard scripting, so use this at your own risk, and feel free to comment, or propose any additions.

(updated, violin family \> violins added)

.  
**Important note:**

The script gives good results for me when using the Standardize Performers plugin.  
Without it it might not result in what you are expecting/hoping for.

.  
EDIT  
Updated version to be found here:

> [@A script to correct 'membranophones' and guitar/violin 'families'](https://community.metabrainz.org/t/a-script-to-correct-membranophones-and-guitar-violin-families/399479):
>
> 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 …

---

_[View the full topic](https://community.metabrainz.org/t/picard-script-for-handling-instrument-families-and-more/400010)._
