Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Convert replaygain to iTunes/iPod volume? (Read 84903 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Convert replaygain to iTunes/iPod volume?

Reply #25
It's just a comment frame with the description iTunNORM, nothing weird about that.

Mp3tag can add "dummy" iTunNORM comment fields, but it must be done in a certain way.
In can't be done in foobar because it doesn't support ID3v2 comment frame descriptions.

Convert replaygain to iTunes/iPod volume?

Reply #26
What's this certain way of adding the dummy tag using Mp3tag? I don't want iTunes to rewrite my tags...

Convert replaygain to iTunes/iPod volume?

Reply #27
Ok, some time has passed and it has become a bit easier now, but you need the version 2.36d from http://developer.mp3tag.de/

1. Select your files and press ALT+T
2. Create a new field with the name COMMENT ITUNNORM
3. Fill in a fake soundcheck value like:
" 00000F0A 000003E2 000054FF 00003C89 00008AFA 00006158 0000842C 000084CF 0002FF0A 0001DDC1"
(without the " signs)
Note: There is a space at the beginning of the value!

Convert replaygain to iTunes/iPod volume?

Reply #28
For those who use linux, or have cygwin installed, I wrote a nice script for ipodrg (using album replaygain):

Code: [Select]
#!/bin/bash

find -regex '^.*\.mp3$' > file_list

for i in $(seq 1 $(wc file_list | awk '{print $1}')); do
  FILE=$(head -n${i} file_list | tail -n1)
  ipodrg "${FILE}" a
done

rm file_list


Just put your ipodrg executable in /usr/local/bin.  Many thanks to Johan!  Now I just have to figure out how to get rid of those squares at the end of tags in iTunes, when the tags were written in foobar.  I had my fingers crossed that iTunes 7 would fix this, but I was let down.

Mark

Convert replaygain to iTunes/iPod volume?

Reply #29
Ok, some time has passed and it has become a bit easier now, but you need the version 2.36d from http://developer.mp3tag.de/

1. Select your files and press ALT+T
2. Create a new field with the name COMMENT ITUNNORM
3. Fill in a fake soundcheck value like:
" 00000F0A 000003E2 000054FF 00003C89 00008AFA 00006158 0000842C 000084CF 0002FF0A 0001DDC1"
(without the " signs)
Note: There is a space at the beginning of the value!

OK, dano & I recently worked out that this only works in mp3tag if you use the iso option for ID3 v2.3 Tag.

UTF 16 & UTF 8 will create the field & value  but ipodrg.exe couldn't recognize that as an itunesNorm tag, you'll get an error message, soundcheck tag missing or similar.

I have still one problem:

Johan's command line only works in the cmd windows
FOR /R %1 IN (*.mp3) DO ipodrg.exe "%1" a >> "C:\Replaylog.txt"

If I put this code into a batch file like this it doesn't work for syntactical reason => (*.mp3) doesn't work at this point for syntactic reasons.

Do you have a tip that it will work in a batch file?
Thanks
Wolfgang

Batch (the path ipodrg.exe is already set in the environment)
del "C:\Replaylog.txt"
c:
cd "\1980"
FOR /R %1 IN (*.mp3) DO ipodrg.exe "%1" a >> "C:\Replaylog.txt"

Convert replaygain to iTunes/iPod volume?

Reply #30
It's too bad ipodrg does not work with MPEG4 tags
Sr. Codec Engineer (video) | RealNetworks Codec Group | helixcommunity.org 
This information is provided "AS IS" with no warranties,  grants no rights, and reflects my personal opinion.

Convert replaygain to iTunes/iPod volume?

Reply #31
It's now also possible to use only Mp3tag for the job (v2.37c required). Works also for AAC in mp4 container.

If you have added RG-tags with foobar2000, you can get the sound check values with the new $rg2sc() function:
$rg2sc(%REPLAYGAIN_TRACK_GAIN%)
$rg2sc(%REPLAYGAIN_ALBUM_GAIN%)

Convert replaygain to iTunes/iPod volume?

Reply #32
It's now also possible to use only Mp3tag for the job (v2.37c required). Works also for AAC in mp4 container.

If you have added RG-tags with foobar2000, you can get the sound check values with the new $rg2sc() function:
$rg2sc(%REPLAYGAIN_TRACK_GAIN%)
$rg2sc(%REPLAYGAIN_ALBUM_GAIN%)

Sounds great :-)
What's the preferred working order to prevent iTunes from touching any of the tags? Should SoundCheck be enabled before or after the values are converted in Mp3tag?

Convert replaygain to iTunes/iPod volume?

Reply #33
It's now also possible to use only Mp3tag for the job (v2.37c required). Works also for AAC in mp4 container.

Pretty nice. Seems to work as expected. However, interaction with iTunes is problematic:
1) iTunes does not re-read the tag after it's been modified with mp3tag, probably since iTunes keeps the tag info in its own database.
2) If deleting the files from the iTunes database, then re-importing the songs, iTunes recalculates and overwrites the ITUNNORM tag. Thus, back to square one...
Sr. Codec Engineer (video) | RealNetworks Codec Group | helixcommunity.org 
This information is provided "AS IS" with no warranties,  grants no rights, and reflects my personal opinion.

Convert replaygain to iTunes/iPod volume?

Reply #34
I currently have iTunes 7.0.2.16

1) It reads the tag again if I do right click > Information or if I just play the file it uses the new volume.
2) Also negative here. No recalculation is done.

Note: For mp3 you must use iso-8859-1 tag encoding in Mp3tag at the moment and AAC files should have m4a extension.

Convert replaygain to iTunes/iPod volume?

Reply #35
dano: I think my "Replace with regular expression" function is not set up correctly in mp3tag...  After I run it, ITUNNORM changes to 000003E8 000003E8 ... ... ... no matter what the RG album gain is. Could you please indicate how you are using the function in mp3tag?
Sr. Codec Engineer (video) | RealNetworks Codec Group | helixcommunity.org 
This information is provided "AS IS" with no warranties,  grants no rights, and reflects my personal opinion.

Convert replaygain to iTunes/iPod volume?

Reply #36
Ok I've uploaded the 4 possible actions here.
Extract to
%APPDATA%\Mp3tag\data\actions

Convert replaygain to iTunes/iPod volume?

Reply #37
Excellent. Everything works fine now. Thanks!
Sr. Codec Engineer (video) | RealNetworks Codec Group | helixcommunity.org 
This information is provided "AS IS" with no warranties,  grants no rights, and reflects my personal opinion.

Convert replaygain to iTunes/iPod volume?

Reply #38
So let's say I wanted to do the following:

1. Run ReplayGain calculation (in either Album or Track mode - specifiable) and write the relevant values to ID3 or APE  tags.
2. Read the tags just created and write the COMMENT ITUNNORM tag (based on the RG to SC formula).

And I wanted to do it in Windows, via a batch file or preferably, VBScript.

I'm not opposed to writing something myself if such a mechanism doesn't already exist, but I'm keen to leverage what I can.

Any suggestions?

Convert replaygain to iTunes/iPod volume?

Reply #39
An extra tip, you should place the directory location of ipodrg.exe in the PATH environment variable. Then it can be executed easily from every directory.
-change the path permanently in System Properties, Advanced, Environment variable
-or type:
Code: [Select]
set PATH=%PATH%;c:\utils
in the Command Prompt

and place ipodrg.exe in c:\utils


Hi. Im trying to make batch file for ipodrg.exe whole day, but it is still not working...

Can you please, send me full example of batch file and settings? (i thought it would be easy, but i cant figure it out...) thanks
---

And one more question: does replaygain and soundcheck save to same id3 field? Or if I add replaygain info and iTunes rewrites my mp3s soundcheck info, I can get it back by running ipodrg batch again?

Convert replaygain to iTunes/iPod volume?

Reply #40

An extra tip, you should place the directory location of ipodrg.exe in the PATH environment variable. Then it can be executed easily from every directory.
-change the path permanently in System Properties, Advanced, Environment variable
-or type:
Code: [Select]
set PATH=%PATH%;c:\utils
in the Command Prompt

and place ipodrg.exe in c:\utils


Hi. Im trying to make batch file for ipodrg.exe whole day, but it is still not working...

Can you please, send me full example of batch file and settings? (i thought it would be easy, but i cant figure it out...) thanks
---

And one more question: does replaygain and soundcheck save to same id3 field? Or if I add replaygain info and iTunes rewrites my mp3s soundcheck info, I can get it back by running ipodrg batch again?


If you just want to do it from the command line, I use:
for %f in (*.mp3) do path\to\ipodrg.exe "%f" t
Example: for %f in (*.mp3) do d:\util\ipodrg.exe "%f" t

If you want to use the above line in a batch file, you need to use double % for the variable like as follows:
for %%f in (*.mp3) do d:\util\ipodrg.exe "%%f" t

Quote
It's now also possible to use only Mp3tag for the job (v2.37c required). Works also for AAC in mp4 container.


I have tried using Mp3tag (v2.37j) to create SoundCheck tags and for some reason the files that were attached weren't doing it for me, so I made an Action (Convert -> Actions) that seems to do the trick.  No pre-scanning with iTunes required.

Under actions, create a new group. (RG to SoundCheck or something similar)
Create a new action and choose 'Format Value'.
In the field, enter COMMENT ITUNNORM
And the format string $rg2sc(%REPLAYGAIN_TRACK_GAIN%)
And you're done.

Run the action on any file with replaygain tags (from foobar or whatever) and the SoundCheck comment will be added if it doesn't exist or changed to match the replaygain value.

Convert replaygain to iTunes/iPod volume?

Reply #41
I was having trouble running ipodrg from the command line until I used the example given by swyn to come up with:
FOR /R %f IN (*.mp3) DO c:\utils\ipodrg.exe "%f" a
and
FOR /R %f IN (*.mp3) DO c:\utils\ipodrg.exe "%f" a >> "c:\utils\log.txt"

However, I am not able to generate a report using the rgsc utility, presumably the usage is:
rgsc iTunesDB
But that evidently assumes I know more than I do, because I am not able to get any results using the rgsc utility. I either get an error: "ERROR: Could not open input file!" (when I literally used "iTunesDB"), or I get a "0" result when I used "rgsc iTunes Library.itl" from the directory in which the file is located -
C:\Documents and Settings\David\My Documents\My Music\iTunes
The result: "Amount of tracks: 0"

So, I am doing something very wrong. When I ran the ipodrg utility to create "log.txt" (second cmd line, above), a text file with all my mp3 songs was created with both the values, for example:
Filename: D:\Music\Carole King\Tapestry\02 - So Far Away - Carole King - Tapestry.mp3
Album Gain: -4.750000
Sound Check: 00000BA9
Lots and lots of tracks with both album gain and sound check values.

So please advise how to properly write the cmd line to use the rgsc utility. Thanks.