Vgm ptch

From vgmrips

General VGM patching utility; allows editing the VGM header (chip clocks/chip settings), checking/fixing VGMs and stripping chips/channels.

Please note: vgm_ptch always edits the original file(s). It doesn't create new files, so you probably want to create your own backups first.

Help

Usage:

vgm_ptch [-command1] [-command2] file1.vgm file2.vgz

Command names are case insensitive.

General Commands

-Help Show this help
-ChipCmdList List all supported chips with SetHzxx command
-StripList List all supported chips and channels for the Strip command

Patching Commands

Command format: -command:value)
-SetVer Set Header-Version (e.g. 1.51, don't use with v1.00-1.10)
-UpdateVer Update Header-Version (additional changes if neccessary)
-MinHeader Minimize Header Size (v1.50+, useful after stripping chips)
-MinVer Minimize VGM Version (v1.50+, useful after stripping chips)
-SetRate Sets the Playback rate (v1.01+)
-SetHzxxx Sets the xxx's chip clock (see -ChipCmdList for details)
-SetLoopMod Set the Loop Modifier (Format: *2, /2.0, 0x20)
-SetLoopBase Set the Loop Base (-128 to 127)
-SetVolMod Set the Volume Modifier (Format: 1.0, 0x00)

Commands to check the lengths (total, loop) and offsets (EOF, loop, GD3)

-Check asks for correction
-CheckR read only mode
-CheckL autofix mode, recalculates lengths
-CheckO like above, but tries to relocate loop offset
-Strip Strip the data of a chip and/or channel (see below). Does not yet work with all chips.

Tip: Stripping without commands optimizes the delays.

Stripping Format

-Strip:Chip[-Num][:Ch,Ch,...];Chip

e.g.:

-Strip:PSG:0,1,2,Noise,Stereo; YM2151
-Strip:YM2612-0; OKIM6295-1


Stripping unused chips from a VGM

First use vgm_cnt on it to see if there really are any unused chips. Unused chips will usually have 0 for both Commands and Notes. The SEGA VDP PSG is probably unused if it has no Notes.

If you do find an unused chip, you can strip it with the Strip option, specifying the chip (and channel, if necessary), such as like the following examples.

vgm_ptch -Strip:AY8910-0 file.vgm; strip first AY chip
vgm_ptch -Strip:AY8910-1 file.vgm; strip second AY chip
vgm_ptch -strip:ym2151 "04 Credit SFX.vgm"; strip YM2151