Vgm trim

From vgmrips
Jump to: navigation, search

vgm_trim is a tool for trimming and looping VGM files.

Usage:

vgm_trim <file.vgm> startSample loopSample endSample

Example:

vgm_trim track1.vgm 15280 23499 194222

The parameters startSample, loopSample and endSample are expressed in 44100Hz samples. Usually, you can use vgmlpfnd to obtain a reasonable loopsample and endsample before getting a good startsample with vgm2txt

You can have different approaches to the workflow of finding good sample points. One approach (used by MaliceX) where vgmlpfnd fails to find a good loop point, you can fall back to listening for the approximate looping times, then use `vgm2txt` to trace for the sample values to use for looping. Sometimes it is useful to use a 44100Hz WAV recording and finding the approximate sample points with an audio editing software, such as Audacity, Wavosaur, Sony Sound Forge among others, then cross-checking the desired sample values with vgm2txt.

If you're familiar with assembly, the intuition of using vgm2txt to finding the best sample point through looking for the relevant command patterns should be similar to finding a good opcode to replace with a JMP in a disassembly.