# Add Album Volume Increase via Replay Gain Tag

**URL:** https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978
**Category:** Support
**Created:** [October 20, 2010, 1:31pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978 "2010-10-20T13:31:43Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [February 2, 2012, 3:56pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/21 "2012-02-02T15:56:59Z")

</div>

> [@kieranwood85](#):
>
> Ok so I might be misunderstanding the scales being used, but the problem is,  
> -6.51 + 6.00 = -0.51  
> -6.51 + 7.00 = 0.49  
> ...

Sorry to complain, but I did demonstrate by the picture in my previous post, that the given formula works without error.  
So please give a detailed hint, what is wrong with the formula, maybe I am currently blind to see it.

Be aware of the integer math and the string related scripting language used in Mp3tag.

This works for me ...

 ![](https://community.mp3tag.de/uploads/default/original/2X/b/bc5e124c8857058c83c1f6a25f27cafebb284428.png)  

Hmm ... got it!  
-6.51 + 6 must be negatve and should be -0.51.  
I will have a look into the maths.

DD.20120202.1808.CET

 ![](https://community.mp3tag.de/uploads/default/original/2X/b/bc5e124c8857058c83c1f6a25f27cafebb284428.png)

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [February 2, 2012, 7:01pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/22 "2012-02-02T19:01:52Z")

</div>

**Add or subtract negative or positive value to REPLAYGAIN\_TRACK\_GAIN value or REPLAYGAIN\_ALBUM\_GAIN value.**

For example ... add + 6dB to the existing value in the tag-field REPLAYGAIN\_TRACK\_GAIN.

Action: Format value  
Field: REPLAYGAIN\_TRACK\_GAIN  
Formatstring:

**$replace($if($less($add($num($replace(%replaygain\_track\_gain%,'.',),1),'+600'),0),'-',)$replace($div($add('+600',$replace(%replaygain\_track\_gain%,'.',)),100),'-',)'.'$num($replace($mod($add('+600',$replace(%replaygain\_track\_gain%,'.',)),100),'-',),2),'--','-')' dB'**

From:  
2.02 dB  
-2.78 dB  
-6.51 dB  
To:  
8.02 dB  
3.22 dB  
-0.51 dB

To adapt the formula to your needs, replace all text strings '+600' within the above example formatstring with your special value (three replaces).  
For example ...  
'+450' ... represents +4.50 dB  
'-450' ... represents -4.50 dB

Better to create an action group ...  
and adapt only once the modifier value for the tag-field RGTG\_MODIFIER within the group's action #1.

Begin Action Group **RGTG.Modify** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_MODIFIER**  
_Formatstring:_ **+600**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_TRACK\_GAIN**  
_Formatstring:_ **$replace($if($less($add($num($replace(%replaygain\_track\_gain%,'.',),1),%RGTG\_MODIFIER%),0),'-',)$replace($div($add(%RGTG\_MODIFIER%,$replace(%replaygain\_track\_gain%,'.',)),100),'-',)'.'$num($replace($mod($add(%RGTG\_MODIFIER%,$replace(%replaygain\_track\_gain%,'.',)),100),'-',),2),'--','-')'÷dB'**

 

Action #3  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **RGTG\_MODIFIER**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **RGTG.Modify** (3 Actions)

DD.20120202.2102.CET

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [February 2, 2012, 8:02pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/23 "2012-02-02T20:02:45Z")

</div>

**Add or subtract negative or positive value to REPLAYGAIN\_TRACK\_GAIN value or REPLAYGAIN\_ALBUM\_GAIN value.**

Here are two action groups, which perhaps are easier to read and to understand how the process of adding or subtracting of a value works, than an endless Mp3tag one line tape worm scripting expression.

The modifier value (numeric string with leading +/- sign character), for example _+600_ (represents +6 dB) or _-450_ (represents -4.5 dB) or whatever value is allowed by the ReplayGain method, can be set in the first action from each action group.

Each action group takes care and tries to store the group of four ReplayGain values in the same order into the media file as it might be expected by other ReplayGain ready applications.  
Above in this thread read about the behaviour of WinAmp when the order of the ReplayGain tag-fields is disarranged.

Begin Action Group **RG#ReplayGainTrackGain.Modify** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_MODIFIER**  
_Formatstring:_ **+600**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_TEMP**  
_Formatstring:_ **%REPLAYGAIN\_TRACK\_GAIN%**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_TEMP**  
_Formatstring:_ **$num($replace(%RGTG\_TEMP%,'.',),1)**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_TEMP**  
_Formatstring:_ **$add(%RGTG\_TEMP%,%RGTG\_MODIFIER%)**

 

Action #5  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_SIGN**  
_Formatstring:_ **$if($less(%RGTG\_TEMP%,0),'-',)**

 

Action #6  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_TEMP**  
_Formatstring:_ **$trimLeft(%RGTG\_TEMP%,'-')**

 

Action #7  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGTG\_TEMP**  
_Formatstring:_ **$div(%RGTG\_TEMP%,100)'.'$num($mod(%RGTG\_TEMP%,100),2)**

 

Action #8  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_TRACK\_GAIN**  
_Formatstring:_ **%RGTG\_SIGN%%RGTG\_TEMP%'÷dB'**

 

Action #9  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **RGTG\_TEMP;RGTG\_SIGN;RGTG\_MODIFIER**

 

Action #10  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_ALBUM\_GAIN**  
_Formatstring:_ **%REPLAYGAIN\_ALBUM\_GAIN%**

 

Action #11  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_ALBUM\_PEAK**  
_Formatstring:_ **%REPLAYGAIN\_ALBUM\_PEAK%**

 

Action #12  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_TRACK\_GAIN**  
_Formatstring:_ **%REPLAYGAIN\_TRACK\_GAIN%**

 

Action #13  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_TRACK\_PEAK**  
_Formatstring:_ **%REPLAYGAIN\_TRACK\_PEAK%**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **RG#ReplayGainTrackGain.Modify** (13 Actions)

Begin Action Group **RG#ReplayGainAlbumGain.Modify** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGAG\_MODIFIER**  
_Formatstring:_ **+600**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGAG\_TEMP**  
_Formatstring:_ **%REPLAYGAIN\_ALBUM\_GAIN%**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGAG\_TEMP**  
_Formatstring:_ **$num($replace(%RGAG\_TEMP%,'.',),1)**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGAG\_TEMP**  
_Formatstring:_ **$add(%RGAG\_TEMP%,%RGAG\_MODIFIER%)**

 

Action #5  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGAG\_SIGN**  
_Formatstring:_ **$if($less(%RGAG\_TEMP%,0),'-',)**

 

Action #6  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGAG\_TEMP**  
_Formatstring:_ **$trimLeft(%RGAG\_TEMP%,'-')**

 

Action #7  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **RGAG\_TEMP**  
_Formatstring:_ **$div(%RGAG\_TEMP%,100)'.'$num($mod(%RGAG\_TEMP%,100),2)**

 

Action #8  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_ALBUM\_GAIN**  
_Formatstring:_ **%RGAG\_SIGN%%RGAG\_TEMP%'÷dB'**

 

Action #9  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **RGAG\_TEMP;RGAG\_SIGN;RGAG\_MODIFIER**

 

Action #10  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_ALBUM\_GAIN**  
_Formatstring:_ **%REPLAYGAIN\_ALBUM\_GAIN%**

 

Action #11  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_ALBUM\_PEAK**  
_Formatstring:_ **%REPLAYGAIN\_ALBUM\_PEAK%**

 

Action #12  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_TRACK\_GAIN**  
_Formatstring:_ **%REPLAYGAIN\_TRACK\_GAIN%**

 

Action #13  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **REPLAYGAIN\_TRACK\_PEAK**  
_Formatstring:_ **%REPLAYGAIN\_TRACK\_PEAK%**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **RG#ReplayGainAlbumGain.Modify** (13 Actions)

The Mp3tag MTA files ...

[RG\_ReplayGainTrackGain.Modify.mta](https://community.mp3tag.de/uploads/default/original/2X/2/2c940e38b6c02b9a8797bae85c6bf29852c9029c.mta) (802 Bytes)  
[RG\_ReplayGainAlbumGain.Modify.mta](https://community.mp3tag.de/uploads/default/original/2X/c/c6c107b9359a86d6a05bec9b5cd2fc358356df82.mta) (802 Bytes)

DD.20120202.2202.CET

[RG\_ReplayGainAlbumGain.Modify.mta](https://community.mp3tag.de/uploads/default/original/2X/c/c6c107b9359a86d6a05bec9b5cd2fc358356df82.mta) (802 Bytes)

[RG\_ReplayGainTrackGain.Modify.mta](https://community.mp3tag.de/uploads/default/original/2X/2/2c940e38b6c02b9a8797bae85c6bf29852c9029c.mta) (802 Bytes)

---

<div class="post-metadata">

### Author: ![Doug\_Mackie](https://community.mp3tag.de/user_avatar/community.mp3tag.de/doug_mackie/32/279_2.png) [@Doug\_Mackie](https://community.mp3tag.de/u/Doug_Mackie)
#### Post date: [December 3, 2021, 4:00pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/24 "2021-12-03T16:00:13Z")

</div>

I was so happy to find DetlevD's replay gain Action above, **RG\_ReplayGainTrackGain.Modify.mta**. It works perfectly and it saves me a tremendous amount of work.

Anyway, I have one minor addition. After using this action to modify large numbers of files, I had trouble remembering or seeing which files I had modified, after the fact. So I added a short action at the end of Detlev's actions which adds a code at the end of each comment tag. My code is "RPG+4", signifying a 4 dB boost to the previous track replay gain values, but you could use any convenient code. Previous content in the comment tag is left undisturbed. My Action is:

_Action #13_  
_Actiontype 5:_ **Format value**  
_Field\_\_\_\_\_\_\_:_ **COMMENT**  
_Format String:_**%comment%$char(13)$char(10)RPG+4**

With " **RPG+4**" embedded in files, I can now use a simple view filter to detect files that have not yet had their replay gain values modified:

**NOT %comment% HAS "RPG+4"**

I thought about creating a custom tag to hold the code but that seemed like overkill.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 3, 2021, 5:19pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/25 "2021-12-03T17:19:17Z")

</div>

> [@Doug\_Mackie](#):
>
> _Format String:_ **%comment%$char(13)$char(10)RPG+4**

If you add the extra bit with a line break at the end, then it could lead to suprises if you export that data as CSV or a similar format that expects data to be a single line. Either you take care of that during export or you use a different separator straight away. Or you leave it like that as it is no problem for you.

---

<div class="post-metadata">

### Author: ![Doug\_Mackie](https://community.mp3tag.de/user_avatar/community.mp3tag.de/doug_mackie/32/279_2.png) [@Doug\_Mackie](https://community.mp3tag.de/u/Doug_Mackie)
#### Post date: [December 3, 2021, 6:03pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/26 "2021-12-03T18:03:55Z")

</div>

As requested by LyricsLover, here is my complete MTA file, as modified from DetlevD's original to add a 4 dB boost and to add to the Comment tag:

[Replay Gain Boost Track Gain +4 dB.mta](https://community.mp3tag.de/uploads/short-url/acj6nCLUpTEbawlnh1KWUUMV40W.mta) (864 Bytes)

---

<div class="post-metadata">

### Author: ![Doug\_Mackie](https://community.mp3tag.de/user_avatar/community.mp3tag.de/doug_mackie/32/279_2.png) [@Doug\_Mackie](https://community.mp3tag.de/u/Doug_Mackie)
#### Post date: [December 3, 2021, 6:14pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/27 "2021-12-03T18:14:54Z")

</div>

Thanks for the suggestion, ohrenkino. I never export comments but others may well. Using a space character as separator should work fine here. I added the line break to make the code easier to spot.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:22pm UTC](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978/28 "2026-02-09T12:22:37Z")

</div>



[Previous page](https://community.mp3tag.de/t/add-album-volume-increase-via-replay-gain-tag/10978.md?page=1)
