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

**URL:** https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875
**Category:** MusicBrainz Picard
**Created:** [August 4, 2020, 3:13pm UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875 "2020-08-04T15:13:47Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Jaydiohead](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jaydiohead/32/30839_2.png) [@Jaydiohead](https://community.metabrainz.org/u/Jaydiohead)
#### Post date: [August 4, 2020, 3:13pm UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/1 "2020-08-04T15:13:47Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [August 4, 2020, 3:54pm UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/2 "2020-08-04T15:54:07Z")

</div>

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

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

```

---

<div class="post-metadata">

### Author: ![scotia](https://community.metabrainz.org/user_avatar/community.metabrainz.org/scotia/32/34465_2.png) [@scotia](https://community.metabrainz.org/u/scotia)
#### Post date: [August 4, 2020, 4:34pm UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/3 "2020-08-04T16:34:56Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![scotia](https://community.metabrainz.org/user_avatar/community.metabrainz.org/scotia/32/34465_2.png) [@scotia](https://community.metabrainz.org/u/scotia)
#### Post date: [August 5, 2020, 2:46am UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/4 "2020-08-05T02:46:26Z")

</div>

Awake now and tried the following:

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

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

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [August 5, 2020, 4:43am UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/5 "2020-08-05T04:43:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![scotia](https://community.metabrainz.org/user_avatar/community.metabrainz.org/scotia/32/34465_2.png) [@scotia](https://community.metabrainz.org/u/scotia)
#### Post date: [August 5, 2020, 5:51am UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/6 "2020-08-05T05:51:10Z")

</div>

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

> [@Jaydiohead](#):
>
> …update the album name tag…

However thanks for clarifying about when those variables are available. The documentation at [https://picard.musicbrainz.org/docs/tags/](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:

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

---

<div class="post-metadata">

### Author: ![scotia](https://community.metabrainz.org/user_avatar/community.metabrainz.org/scotia/32/34465_2.png) [@scotia](https://community.metabrainz.org/u/scotia)
#### Post date: [August 5, 2020, 1:12pm UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/7 "2020-08-05T13:12:42Z")

</div>

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

---

<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: [August 5, 2020, 5:01pm UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/8 "2020-08-05T17:01:52Z")

</div>

> [@scotia](#):
>
> With your suggestion of:
> 
> ```auto
> $if($eq(%_bits_per_sample%,24), \(Hi-Res\))
> 
> ```
> 
> it’s not obvious to me which tag is being set. What am I missing?

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.

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [August 5, 2020, 5:24pm UTC](https://community.metabrainz.org/t/add-hi-res-after-album-name-tag-if-bitdepth-is-24bits/488875/9 "2020-08-05T17:24:09Z")

</div>

> [@scotia](#):
>
> Unless the OP has been edited, @Jaydiohead didn’t even mention file naming, rather:

Yep, sorry. I misread the OP
