Page 1 of 1

Separator for Multiple Values and Swapping Fields

Posted: Thu May 31, 2012 7:30 pm
by guptaas
Thank you for bringing the greatest tagger of all time back. Couple of problems I can't solve without some skill at scripts:

--Are multiple values supported for most fields?
--How do I substitute a semi-colon for a comma to separate multiple values in fields like Genres, Tones, Styles etc?
--How can I direct results of the AMG script from one field to another e.g. "Tones" to "Mood" or "Themes" to "Situation"
--Can I merge two fields? I'd like to combine AMG results of "Genre" and "Styles" into "Styles"
--A way to translate an "AMG Pick" into a rating of "5" for MP3's and "100" for FLAC's would be great

Any help appreciated. Even directing to a source where I can teach myself some scripting or a list of commands might work. Thanks

Re: Separator for Multiple Values and Swapping Fields

Posted: Fri Jun 01, 2012 2:45 pm
by jtclipper
Multiple values is generally data separated with chr(0) , tgf at the moment does not read past the chr(0) part but since you brought this up I'll add support for reading/saving multiple values in the next beta, hopefully soon enough.

Almost everything else you posted is possible with scripting, I will post some commands which you can place directly before the 'finally' command in the script, so just let the script do its work and then add a few lines to get your desired result.

Code: Select all

//How do I substitute a semi-colon for a comma to separate multiple values in fields like Genres, Tones, Styles etc?
    on_setGenre( AnsiReplaceStr(on_getGenre, ',', ';' ))
    on_setTones( AnsiReplaceStr(on_getTones, ',', ';' ))
    on_setStyles( AnsiReplaceStr(on_getStyles, ',', ';' ))

//Can I merge two fields? I'd like to combine AMG results of "Genre" and "Styles" into "Styles"
   on_setStyles( on_getGenre + ';' + on_getStyles )
--A way to translate an "AMG Pick" into a rating of "5" for MP3's and "100" for FLAC's would be great
Not directly supported sorry

--How can I direct results of the AMG script from one field to another e.g. "Tones" to "Mood" or "Themes" to "Situation"
For this you will need another script to execute, this is not a grabber script it's an online script available on the right part of the UI (above the album info), its an .scl file.
When you execute this you are done with renaming & updating automatically.
Also themes are saved in situation so you don't have to do anything.

Code: Select all

program swapfields;
var
 i: integer;
begin
  // apply update and rename the files automatically
  on_Apply;
  on_Update;
  on_Rename;
  for i := 1 to on_getGrdRowCount do begin
      on_setGrdRow( i );

      on_LoadFile;
      gTag.Mood := gTag.Tones;
      gTag.Tones := '';

      gTag.SaveToFile( 0, false, '', false );
  end;
  on_Refresh;
  on_setGrdRow( 1 );
end.
Try to test everything on a copy of your files first.

Handling different file formats

Posted: Sat Jun 02, 2012 6:57 pm
by guptaas
Thank you so much. That is working beautifully. I can hopefully do further tweaking myself.
Here is another issue: I haven't come across any way to handle the differences between ID3v2 and VorbisComment during an Online update. Is their a way to map fields between formats? Alternatively, is their a way to insert file format differences into an scl file: For example, AMG "Album Moods" > The Godfather "TONES" > "MOOD" for a FLAC/"TMOO" for an MP3.

Thanks again for the fantastic work.

Re: Separator for Multiple Values and Swapping Fields

Posted: Mon Jun 04, 2012 4:00 pm
by Wurlitzer
@jtclipper

Maybe I'm too stupid, but although your code examples are very helpful, I can't find a way to substitute "/" with "," in the composer field. The new AMG script works fine, but I want to have the composer "comma-separated" as it was realized in the AMG script before relaunch.

Concerning multiple values: please take into account that separators for multiple values can be used in flexible way as there are established quasi-standards in the most popular music programs (for example multiple genres are separated with ";" in many programs).

AMG pick: is it possible to grab it using a TXXX-frame with value "X" for all picked songs?

Bye Byte and Happy Coding
Wurlitzer

Re: Handling different file formats

Posted: Mon Jun 04, 2012 6:18 pm
by jtclipper
guptaas wrote: Here is another issue: I haven't come across any way to handle the differences between ID3v2 and VorbisComment during an Online update. Is their a way to map fields between formats? Alternatively, is their a way to insert file format differences into an scl file: For example, AMG "Album Moods" > The Godfather "TONES" > "MOOD" for a FLAC/"TMOO" for an MP3.
MOOD is used for flac files but for mp3's a user defined fields MOOD is used TMOO is an ID3 2.4 version frame and tgf does not save as 2.4 for various reasons.

Re: Separator for Multiple Values and Swapping Fields

Posted: Mon Jun 04, 2012 6:22 pm
by jtclipper
Wurlitzer wrote:@jtclipper
Maybe I'm too stupid, but although your code examples are very helpful, I can't find a way to substitute "/" with "," in the composer field. The new AMG script works fine, but I want to have the composer "comma-separated" as it was realized in the AMG script before relaunch.
Check for the 'sComposer := ' in line 67 directly after that you can do this

Code: Select all

sComposer := AnsiReplaceStr( sComposer, '/', ';' );
Also remember when modifying scripts that their filename starts with an # (system scripts) always use save as.. and work with your own copy.

Re: Separator for Multiple Values and Swapping Fields

Posted: Tue Jun 05, 2012 2:25 pm
by Wurlitzer
Thank you jtclipper,
you've made my day!

Re: Separator for Multiple Values and Swapping Fields

Posted: Fri Jun 08, 2012 12:36 am
by guptaas
Thank you so much. I needed the composer separator as well.