QUOTE(Lyx @ Feb 13 2008, 23:53)

EDIT: Possibly there is another solution which could be implemented on foobar's side, which would do away with such conflicts alltogether.... but i dont know enough technical details to know if there are problems with it.
1. Allow to read from any combination of ID3v1, ID3v2 and APE. Read the tags in the order "APE > ID3v2 > ID3v1". Merge the results. If any metadatafield exists in more than one of the available tags, then just give priority to the higher order tag-type. Discard anything else.
2. Allow writing to ID3v2 and APE simultaneusly, regardless of it being pointless from an idealistic POV. However, always sync all tags which are written to, when writing. Thus, if a file had mixed metadata in ID3v1, ID3v2 and APE, then the resulting written file will have the same metadata written to all tagtypes (taking into account tagtype limits, i.e. with ID3v1). Thus, in the mp3gain-scenario, the stuff written in ID3v2 would be mirrored to APE, and the undo-data in the APE-tag would be mirrored to ID3v2.
I think you've got it. That would be a less principled but imho much more practiable and yet logical consisent approach (as for merging, the tag priority order would also apply: e.g. if there is a tag specified both in APE
only or both in APE and ID3v2, the APE tag will be synced to IDv2 [truncation will be applied if nessesary]; if there is a tag specified in ID3v2 only, it will be synced to to APE).
Strangely enough, that there actually seems to be not a single program capable of merging different tag types in the described manner - or anyhow.... Mp3Tag uses a priority APE > ID3v2 > ID3v1 when reading out tag information but isn't capable of merging at all. Could it be that hard to implement?
Meanwile I figured out a dirty little hack for our problem. So throw away all of yor ideals and go through the following procedure

,
You need Mp3tag in order to do this.
- Apply MP3Gain to your files if you haven't already. (Edit: if you haven't, and you're fine with ID3v1 + APE tags, you can skip this whole procedure and read on at the bottom of this post)
- Start Mp3tag and make shure it's set up to read APE tags (Options/Tags/Mpeg).
- Add the files/folder you applied MP3Gain to.
- Hit Ctr-A and File/Export...
- Add a new export config. Name it mp3gain or something, the e. Paste the following script in to the textfile that pops up:
CODE
$filename(Export.MP3Gain.txt,ANSI)$loop(%_path%)^|%_PATH%|%REPLAYGAIN_TRACK_GAIN%|%REPLAYGAIN_TRACK_PEAK%|%REPLAYGAIN_ALBUM_GAIN%|%REPLAYGAIN_ALBUM_PEAK%|%MP3GAIN_MINMAX%|%MP3GAIN_ALBUM_MINMAX%|%MP3GAIN_UNDO%|$
$loopend()
- Name the export file mp3gain.txt, hit Ok, hit Yes and copy the whole content that pops up to the clipbord
- Start foobar, set prefered tag writing scheme to "APE + ID3v1" and enable "force prefered track writing scheme" in advanced options/tagging/MP3.
- Put the same files in same order on foobars playlist (you can d&d them from mp3gain)
- Hit Ctr-A, start masstagger by clicking tagging/manage scripts
- Add action "input data...", paste the content generated by Mp3tag in the input data-field. Verify that the files listed in it are the same which appear in "files to process"-list.
- Paste the following into the scheme field:
CODE
^|%%|%REPLAYGAIN_TRACK_GAIN%|%REPLAYGAIN_TRACK_PEAK%|%REPLAYGAIN_ALBUM_GAIN%|%REPLAYGAIN_ALBUM_PEAK%|%MP3GAIN_MINMAX%|%MP3GAIN_ALBUM_MINMAX%|%MP3GAIN_UNDO%|$
- Hit Ok, hit run. If you haven't done a backup, pray a little.
- If you've done everything right, you've got mp3s with neat APE tags containing all of the information from the former ID3v2 tags plus MP3Gain which will be kept for now on by foobar.
The only downside on this solution is that you have to dispense ID3v2 tags. There is another, real dirty option if you can't go without them: simply
disable "force prefered track writing scheme" in step (7) - but be very aware of the consequences - foobar now writes MP3Gain and Replaygain Information into the ID3v2 tag and keeps them also in APE tag (why now and not before? Edit: Because they are now copied from ID3v2 to APE). So if you later change the Gain using MP3Gain, only the APE values will be affected whether the ID3v2 tag remains untouched and now contains wrong values. To update these, you'd have to go through the whole procedure again...
Edit:
QUOTE(Bourne @ Feb 13 2008, 18:49)

If you run MP3Gain through your files, they will get tagged with APEv2 tags. If you open these same files in FB2k and update *a single field of any kind* in the tags, the undo information will be gone. The only workaround for this is to set FB2K to manipulate APEv2 tags only, like creating MP3 files only with APEv2 tags and removing any kind of ID3Vx tags. After you know your tags are ALL and ONLY APEv2, then you can change the files in MP3Gain and update tags in FB2K, and the UNDO information will be preserved.
I developed the method above because this suggestion didn't work. When stripping the ID3 tags, foobar still discards the original APE and overwrites it with the former ID3v2 content. But it indeed makes your life easier if you haven't mp3gained your files yet. Just do as in step (7), rewrite tags on all of your files (check it with Mp3tag, they should have only ID3v1 and APE now) and subsequently, apply mp3gain.