Vgm ren

From vgmrips

VGM Renamer

Renames VGMs based on context (described below).

Because vgm_ren does not modify the VGM files (only .m3u playlists; see below) and your finished VGM Title tags will generally have what you want to use for the filename, the tool removes almost all effort from correctly numbering and naming your VGMs. Rearranging track order is as basic as moving lines in the .m3u and running vgm_ren on it; you no longer need to do it by hand or use a batch-renaming tool like that of IrfanView's.

The VGM Tools have been officially updated, and you can now get vgm_ren from the Tools' wiki page/release thread.

How It Works

The renamer uses the English Title field of the VGM's GD3 tag, or the VGM's existing filename if the tag doesn't exist. If the target file aleady exists, vgm_ren won't overwrite it.

Renaming VGMs with a Title tag

If you use vgm_ren on a single VGM with the English Title set, you'll receive results like this:

09 Lively Lava, Spooky Cave_trimmed.vgz -> Lively Lava, Spooky Cave.vgz
9 89 Round 2-P.vgm -> Round 2-P.vgm
dvo.vgm -> Round 2-P.vgm

Some characters are valid in Title tags, but invalid in filenames. These characters are converted into acceptable and nice replacements:

"    -> '
": " -> " - "
"?"  -> [remove]
"!"  -> [remove]
"/"  -> ", "
"\"  -> ", "
"|" -> "-"
"<" -> "("
">" -> ")"

Spaces and dots (.) at the end of the filename before the .vgm or .vgz are removed also.

Marsupilami - Title Screen - Palombie - Stage 1.vgz -> Title Screen/Palombie - Stage 1.vgz

Converting invalid characters is the only case where vgm_ren will use a filename with changes to the Title. vgm_ren never modifies the VGM itself; only the filename.

Renaming VGMs without a Title tag

It works with fairly reasonable preassumptions if using the filename, erring on the side of not overdoing it:

I Just Can't Wait to be King - Copy.vgm -> I Just Can't Wait to be King.vgm
I Just - Can't- Wait to -be King - Copy.vgm -> I Just - Can't- Wait to -be King - Copy.vgm
The Flyin' King - 01 - I Just Can't Wait to be King.vgm -> The Flyin' King - 01 - I Just Can't Wait to be King.vgm
I Just Can't Wait to be King_trimmed_optimized.vgm -> I Just Can't Wait to be King_trimmed_optimized.vgm
04 84 1-1, 1-D, 1-M.vgm -> 04 84 1-1, 1-D, 1-M.vgm

As you can see, the program will refrain from nuking portions that simply use dashes (or underscores) or might legitimately be part of the name. As your VGMs will eventually have Title tags, this isn't a huge problem unless you have many Titles with invalid filename characters.

Using and regenerating a playlist

If given a playlist, vgm_ren will number each track with its position in the .m3u, using the rules/ways above to create track names. If any files are missing, it will ignore them. After renaming the files, it will also rewrite the playlist to use the generated filenames.

VGM or PlayList:        "Joe & Mac.m3u"
04 - Rescue.vgz Error opening the file!
05 - Stage Clear.vgz    Error opening the file!
06 - Stage BGM 2.vgz    Error opening the file!
07 - Stage BGM 3.vgz    Error opening the file!
08 - Boss Theme.vgz     Error opening the file!
 
01 - Title Theme.vgz -> 01 Title Theme.vgz
02 - Introduction.vgz -> 02 Introduction.vgz
03 - Stage BGM 1.vgz -> 03 Stage BGM 1.vgz
09 - Ending Theme.vgz -> 04 Ending Theme.vgz
Writing playlist ...
Done.

You can thus use the program to renumber/reorder the VGMs freely, as many times as you need:

VGM or PlayList:        "Joe & Mac.m3u"

02 Introduction.vgz -> 01 Introduction.vgz
04 Ending Theme.vgz -> 02 Ending Theme.vgz
01 Title Theme.vgz -> 03 Title Theme.vgz
03 Stage BGM 1.vgz -> 04 Stage BGM 1.vgz
Writing playlist ...

This is the only case where vgm_ren changes the contents of any actual file, with almost-certainly desirable results. The .m3u is trivial to fix if anything goes wrong; the renamings should remove almost all effort thereof.

How to Use

Like vgm_stat, the renamer requires a playlist to do optimum work. However, just having a playlist isn't enough to create the desired result:

VGM or PlayList:        "Lion King, The.m3u"

I Just - Can't- Wait to -be King - Copy.vgm -> 01 I Just - Can't- Wait to -be King - Copy.vgm
02 I Just Can't Wait to be King_trimmed.vgm -> 02 I Just Can't Wait to be King_trimmed.vgm
The Flyin' King - 01 - I Just Can't Wait to be King.vgm -> 03 The Flyin' King - 01 - I Just Can't Wait to be King.vgm
Writing playlist ...

To remove warts, the English Title must be filled out.

You can't give multiple files to vgm_ren except by using a playlist: all but the first will be ignored.

With this program, you should never need to rename VGMs/VGZs by hand to get the right order and names.