Add (Hi-Res) after album name tag if bitdepth is 24bits

Hi

Im novice in scripting but i would like musicbrainz picard to update the album name tag adding a fixed mention (Hi-Res) when an album is a 24bit album
Is there anyway to script this ?
I ve searched all the afternoon …

Many many thanks to the one who may know how to do that :slight_smile:

1 Like

Adding the following to the end of your file naming script should to the trick:

$if($eq(%_bits_per_sample%,24), \(Hi-Res\))
3 Likes

I was just fiddling with something similar today but both _bitrate and _sample_rate gave me nothing. I’d love to know if _bits_per_sample works (it’s my bedtime).

1 Like

Awake now and tried the following:

$set(xtest,a:%album% s:%_bits_per_sample% br:%_bitrate% sr:%_sample_rate% f:%_format%)
$set(xtest2,fe:%_extension% rt:%_primaryreleasetype% srt:%_secondaryreleasetype%)
$set(xtest3,st:%releasestatus%)

and the files were tagged with:

xtest:  a:The Dark Side of the Moon s: br: sr: f: 
xtest2: fe: rt:album srt:
xtest3: st:official

So _bits_per_sample, _bitrate, _sample_rate, _format, _extension do nothing for me.

The file variables are currently only available in file naming script, which is what @Jaydiohead actually asked for.

1 Like

Unless the OP has been edited, @Jaydiohead didn’t even mention file naming, rather:

However thanks for clarifying about when those variables are available. The documentation at https://picard.musicbrainz.org/docs/tags/ is incorrect, then.
"This page describes … Picard variables which can be used in Picard scripts (for tagging…)."
Those variables I tested are listed under “Basic Variables”.

With your suggestion of:

$if($eq(%_bits_per_sample%,24), \(Hi-Res\))

it’s not obvious to me which tag is being set. What am I missing?

Any idea how to fix the doco? A ticket?

Thanks.

@Jaydiohead did you get this to work? I’m trying to do the same.

No tag is being set because you can’t set tags in the file naming script. Well, I guess you can set them, but they won’t be written to the file. This is simply adding " (Hi-Res)" to the file name.

Yep, sorry. I misread the OP