[Solved] How can I add a list of instruments to a file or folder name?

Hello, I’m new to MusicBrainz Picard and I was wondering how I can do this…

I’m trying to add the instruments (for a track) to the file or folder name that I am creating elsewhere.

Here’s an album I’m working with:
Ms. Jazz

Here’s the script I’m currently using:
$if2(%albumartist%,%artist%)/

$if(%albumartist%,%album%/,)

$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title% - %performer:instrument%

How do I get the track “You Are the Sunshine of My Life” look like this:

01 You Are the Sunshine of My Life - bass - drums - guitar - piano - tenor saxophone - vocals

So happy I found MusicBrainz! Thanks for any help or suggestions.

You need to install the “Instruments” plugin by David Mandelberg if you want to script on the instruments. It should be as simple as,

$join(%_instruments%, - )

However, you are likely to exceed maximum characters for the filepath.

edit: Fixed typo.

3 Likes

Wow! Thanks for the quick response. I made sure I had downloaded the plugin, and that it was enabled. Restarted MusicBrainz Picard twice to be doubly sure.

Then I went ahead and added it to my “Name files like this” script:

$if2(%albumartist%,%artist%)/

$if(%albumartist%,%album% - %genre%/,)

$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title% - $join(%instruments%, - )

But I’m still not seeing the instruments listed. Sorry if I’m too new to understand what to do here. Any other suggestions?

Again, thank you for your help!

Sorry, it’s %_instruments%

1 Like

I’m noticing that I’m not seeing %_instruments% in my tag list that pops up when I type “%”. I see %performer%.

Not sure what I’m doing wrong or what I have to do :confused:

Likely because %_instruments% is a variable rather than a tag. Items beginning with an underscore are variables and are not saved to the tags, but they can still be used in scripts.

1 Like

Understood. Can you point me to the documentation that will shed light on what I can put in MusicBrainz Picard’s File Naming “Name files like this” script section?

Ultimately, I just want a way to distinguish, either on the folder or file, what instruments are used in a particular song or album.

Thanks for your help.

There’s a File Naming Script Tutorial in the Picard User Guide that might be a good starting point. There are also sections explaining the Scripting Functions and Tags & Variables available by default. Note that this does not include tags & variables or functions that are added using plugins. That documentation is the responsibility of the plugin developer. For example, the documentation for my Additional Artists Variables plugin is available in the repository on github.

EDIT:

The $join(%_instruments%, - ) command suggested by @yindesu earlier should do what you’re asking. If you change the %instruments% in your script to %_instruments%, I think that should do it for you. Also be careful not to exceed the maximum path / filename length as noted by @yindesu.

3 Likes

Thanks for the info…

I’m not sure what the issue is honestly…no matter how hard I try I cannot get performer or instruments to show in this script:

$if2(%albumartist%,%artist%)/

$if(%albumartist%,%album%/,)

$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title% $join(%_instruments%, - )

I’ve tried uninstalling and reinstalling the Instruments plugin, different variations, and it’s just being left blank. I’m new to Picard, so I’m not sure if I should be seeing “performer” or “instrument” data/tags in the “Tag”, “Orginal Value”, or “New Value” columns on Picard.

I got a feeling I have a configuration setting or something along those lines that is stopping those from being set. So even if I dig through the docs, I would need to fix this in order to even show the data in the file/folder name.

Quick question: Is there a way to check (before saving) that the Instrument data has been loaded?

Again, thanks for your help! It is much appreciated.

First check to see if you have the Use track relationships option enabled. Then you may want to install the View Script Variables plugin, which allows you to right-click on a release or track and see the variables loaded. If you’re still not seeing anything, then have a look at the logs to see if there are any warnings or errors that might explain the missing items. Finally, is it possible that the performer relationships aren’t entered for the release that you’re loading? You can check this by viewing the release on the MusicBrainz site.

2 Likes

That did it!!!

Thank you very much for the information. Just in case someone else has the same issues in the future here are the steps that led to a resolution:

  1. [Options → Plugins] Uninstalled “Instruments” plugin from Plugin Options window
  2. “Make It So” and closed out Picard
  3. [Options → Plugins] Installed “Instruments” and “View script variables” plugins
  4. Verified all plugins were enabled, “Make It So” and closed Picard
  5. [Options → Plugins] Verify everything looks good
  6. Loaded up album → Cluster → Select Album cluster → Scan
  7. Right click on Track title → Plugins → View script Variables
  8. Verified that Instrument variables were present for the track
  9. Save
  10. Verified that Instrument data was saved with the file in the new location

I appreciate all your help with this. Can’t wait to start cataloging everything!

4 Likes