Finding Trim Points in WAV Files
To know where to trim if vgmlpfnd and vgm2txt aren't enough, you will need to make a WAV file from a VGM and open it in a program that can display what the music waveform looks like.
Creating .wavs from VGMs
Any music player that can play VGMs and create .wav files can do the trick. We will explore using
- ZXTune
- Winamp + the VGM input plugin, in_vgm
- XMPlay + in_vgm
- VGMPlay
Below are some pointers for experienced loggers; you can skip them and go on to your player of choice.
Using in_vgm has an advantage: you can stop the output for each VGM whenever you think you have enough of it converted, such as when you only need help finding the Start Sample. If it's possible in VGMPlay without mangling the file (or having to skip forward with Right Arrow), I don't know how.
At last report years ago, using Foobar's foo_gep seemed to strip silence you need to trim properly. I'm not sure if this is still the case.
You'll sometimes want to make WAVs of your trimmed VGMs, too: to compare them to the raw logs, and make sure your timing is correct. At those times, you might want to use vgm_trim with 0 for the Start Sample so you don't have to line up the waveforms by hand.

Using ZXTune
- Drag your VGM into the playlist/program
- Right-click on it
- Select Convert
- Under "Select directory", click the "..." button to choose a folder to put your WAVs in
- Under "Specify filename template", make sure it says [Filename]
- Make sure the word under these settings says "WAV" (or "FLAC" for smaller files, especially if you change the Compression to Max/8)
- Click OK
You can convert many VGMs at once. Drag all of them into the playlist, press Ctrl+A to select them all, then right-click and do the same steps as needed.
The files created should already have a frequency of 44100 Hz. If they do not, go to File > Preferences > Sound and change the Sound frequency, then make new WAV/FLAC files.
Using Winamp, the VGM input plugin and the Disk Writer output plugin

- Run Winamp
- Press CTRL+P to open the preference screen
- Go to the "output" section
- Remember or write down the currently-selected output plugin
- Select the "Nullsoft Disk Writer plug-in"
- (if you don't have it, download the full version of Winamp, which has it bundled)
- Click on the configure button below the list
- Set the output directory, or make "Output to directory containing source files" checked
- Select the proper output format: PCM, 16 Bit, Stereo, 44.100 kHz
- Make sure the option "kill null samples" is disabled/unchecked. The .wav won't give you correct times if any samples are removed
- Now go to the input section to configure the VGM input plugin (in_vgm)
- Set "pause after non-looped tracks" to zero
- If shuffle, repeat, the equalizer or any DSP plugin are activated, turn them off. They won't do you any good here.
- Drop the file(s) into Winamp and play them. (No music will play, because the audio is being written to your hard drive instead)
- When Winamp is done writing the files, press CTRL+P again and turn the output plugin back to what was it before you changed it to the disk writer. This way you can listen to files again.
Using XMPlay and in_vgm
- Go into Options and Stuff (press F9, menu-click on XMPlay, or click the wrench icon)
- Go to Input
- Configure the VGM input plugin (in_vgm)
- Make sure Playback Rate is 44100 Hz
- Set "pause after non-looped tracks" to zero
- (Optional) Set Play Loops to 2, so WAVs of trimmed files can be compared to raw logs easily
- Go to Output
- Remember or write down the currently-selected output Device
- Change the Device to "WAV Writer"
- Under "File writing", do one of these:
- Click the Source checkbox to make XMPlay put WAVs in the same folder as the source VGMs
- Choose a specific Folder to place all the WAVs in
- (Optional) Check Auto filename, so the program doesn't ask for one every time
- (Optional) Go to Miscellaneous and uncheck "Auto-loop any track ending with sound"
- Open the VGMs in XMPlay: They'll automatically be written to WAVs.
- When all WAVs have been written, go back into the Output Options and change the Output Device back to what it was before you changed it to WAV Writer.
Using VGMPlay
From the Command Line
VGMPlay -w your_vgm_here.vgm
Via settings
Open VGMPlay.ini in a plain-text editor like Notepad. Find (ctrl+f) and change the following settings as so. (You can also specify them with VGMs on the command line:)
[General]
SampleRate = 44100
JinglePause = 0
FadeRAWLogs = False
Volume = 1.0
LogSound = 1
You can now drop your logs on VGMPlay.exe and wait for output to finish.
The above settings can also be specified on the command line; see VGMPlay's wiki page for details.
Other Players?
Check the readme or options to see if they describe how to convert files.
Sound Editors
- Audacity
- or an Audacity fork like Tenacity, Audacium, or AudioCity. (Info below correct as of 2.0.6... yeah.)
- GoldWave (shareware)
- (Correct as of ~v5)
- ocenaudio
- (Correct info here as of... 2.0.16. Oy. Used much more RAM than Audacity.)
- Wavosaur
- Portable and lightweight; only requires <6mb disk space and uses even less RAM than Audacity... at least until you open a .wav file.
- MIDI files
- Using vgm2mid, it's possible to find loops as well, though I don't know the process to do so.
Any other program like these, which lets you view exact samples (see below) in WAVs/FLACs, is fine too. (This tutorial will use GoldWave for its example images of waveforms.)
Whatever you choose, if you're not used to the program, open any sound file in it and try to do the Everyday Tasks below until you know the interface. Then I'll show you how to find the trim /points/sample numbers you need for vgm_trim.
Everyday Tasks
Many sound editors can mark loop points as you work, via menu options. In Audacity(/ies), I don't know any quick way to do so, except to:
- use Edit -> Region Save/Restore to keep your selection/cursor
- use label tracks on a selection or cursor and move the labels as needed
Viewing in Samples
When viewing a WAV file, you're trying to find the exact start, loop begin (if applicable), and loop/song end points. These numbers should be in samples, not seconds.
In the converting instructions above, the number 44100
appeared. VGM stores data at a resolution of 44100 samples per second (hence, 44.1Hz); that's why it was important that the WAV/FLAC files used this sample rate/frequency too. If your sound editor says the files have that number, you're good to go.
But the default time numbers shown in these programs are in seconds, minutes and so on. To change to sample mode in:
Audacities
At the bottom, you'll see a drop-down list (newer versions), or boxes saying Selection Start, End/Length, and Audio Position (older versions). There are arrows by the numbers below/nearby. Click any of those (or right-click on the numbers themselves), and select "samples".
Selection Toolbar
is checked.GoldWave
There is a status bar at the bottom of the screen giving you a number in the format "__ to __ (__ unit)". Right click on it and select the option that says "__ to __ (__ smp)" (it should be the second to last option). The bar will now give you numbers like "selection-start to selection-end (selection-size smp)".
ocenaudio
Use View -> Display Time Format -> Samples.
Getting the sample numbers for vgm_trim isn't simple. You have two options:
- Hold Alt and move the cursor to make the exact sample number beneath it appear at the bottom. Move the cursor over the trim point you want to find. This is imprecise and best combined with vgm2txt.
- Click to place the cursor before a marker or region (see below). Use Controls -> Move Cursor -> Next Marker; the exact sample will display in the black window at the top. A region counts as a single marker; to see the end sample you must use Edit -> Select Audio from Regions, and the end sample will display. This is precise but a bit of a pain.
Wavosaur
Use Options -> Sample Display -> Samples. The currently-selected range will always be visible next to the track's sample rate (which should of course read 44100 Hz). If there's no selection, the numbers will be the same.
Now the program is giving you what you need: the position of the selection markers in samples. Once you've done this once, you shouldn't need to do it again.
Zooming In/Out on Time and Amplitude
Zooming normally (that is, time-wise/horizontally) is pretty easy, most of the time complete with magnifying-glass icons. But the less-simple amplitude/vertical zoom is something you'll definitely want to know how to do.
Why's that? Some sounds actually start long before you can actually see them at the default amplitude scale (that's how tall the waveforms look). You can make bigger the sound wave on the vertical axis with the sound editor, and see where the VGM('s sound) actually starts. We'll see an example later on, when we learn trim point finding.
Audacity
Right Click and Left Click on the amplitude scale to the left of the waveforms. You can also fit the horizontal selection to the window by pressing CTRL+E.
GoldWave
Press CTRL+UP and CTRL+DOWN. Fit the selection by pressing SHIFT+S.
ocenaudio
There's a magnifying glass in the upper-right corner, next to the waveform. This is used for horizontal and vertical zooming, but doing so is not simple either way.
Without a selection, the glass has a + inside: Click/hold it, and it will zoom in toward the music cursor. With a selection, it has nothing inside: Clicking/holding it will zoom so that the selection fills the window. Hold Ctrl when you click to make the + appear and scroll normally.
Either way, hold Shift to make - appear and zoom out.
To zoom in on amplitude, you must hold the Alt key. Hold Shift at the same time to zoom out.
You can also use View -> Zoom for all these things, and to fit to the selection.
At this point, you no doubt want to know how to scroll left and right while zoomed in. If you hover the cursor over the samples at the bottom, it will change to indicate you can drag. Click and drag left/right to scroll.
Wavosaur
Next to the normal Zoom buttons, you'll find amplitude zoom buttons. Apply as needed.
Finding "Zero Crossings"
Zero Crossings are points at the start and end of a loop that are silent (0.0db), which should make for good and safer loop/end points. You can make the program find these for you.
- Audacities
- Simply press the Z key.
- GoldWave
- Use Edit -> Marker -> Snap to zero crossing.
- ocenaudio
- Use Adjust Selection -> Snap to Zero Cross. This can be found in the Edit menu, or by menu-clicking on your selection.
- Wavosaur
- Use Options -> Snap to zero crossing. This is a toggled option rather than one you activate by pressing, so you'll have to make new selections to use it.
Moving Your Loop Section Around Without Losing the Loop Length
Optional, but extremely handy and worth getting used to.
Audacities (~2.0.6)
- There are two radio buttons after the start point that say End and Length. Push Length.
- Click into or otherwise access Selection Start, so that you can enter numbers there.
- Change the start point as you need by typing.
- When finished and ready to try the new endpoint in vgm_trim, change the radio button back to End.
GoldWave
???
ocenaudio
- Use Edit -> Create Region to create a region from your selection.
- Move the cursor over one of the red region endpoints (at the top) until the cursor becomes a hand with all five fingers extended.
- Click and drag; the entire region should move. Place it where you want.
- If necessary, you can adjust the endpoints now by clicking on them when the hand has only the pointer/index/first finger extended.
- Use Edit -> Select Audio from Regions to regain a selection, so that you can play it and re-check the loop.
There is a feature to convert a region into a loop, but it doesn't appear to be helpful for our needs.
Wavosaur
You'll have to turn a selection of the possible loop into an, uh, Loop (Tools -> Loop -> Create Loop Points). Then open Properties (in the same menu) and change each loop sample by the amount of/to the pair of samples you need.
Finding Trim Points in the WAVs
Trimming VGMs shows the three types of songs, and shows examples of the kind of points you're trying to find. If you've never searched for trim points before, you can practice on the VGMs provided there. (You should also read the whole tutorial for further insight and info, if you haven't already.)
You want to find two to three points:
- The time where the song starts (Start Sample)
- Where it finishes (End Sample)
- Where it jumps to when it finishes, to loop (Loop Sample, which can be 0 to indicate "No Loop" in case of non-looping songs)
For looping songs without an intro, Start Sample and Loop Sample may be the same number.
Now that you know what you're looking for, play the WAV file on your sound editor and find where the song starts. Select the part of the sound around this spot and zoom to fit the view. Zooming in lets you get more precise values. Keep zooming until you get a nice, close look at the sound wave.

This is the start of the Ghouls 'n Ghosts song, as mentioned in Trimming VGMs, in a close zoom. You can take a good look at the sound wave at this scale, but it's not abusively close either.
As you probably noticed, the Start Sample (yellow) is set a few samples away from the first noticeable changes in the wave. This is important because we don't want to trim out the starting commands at the beginning of the music, so we always give a bit of a space. Here's a hint: any space or gap below 500 samples is not noticed by the human ear at all. The above space is only 50 samples, which is less than 2 milliseconds in length!
It's also worth zooming in on the amplitude scale as I mentioned earlier:

This is the last sound wave we saw, with expanded amplitude. The tiny bump you noticed before is now a big obvious hump pointing down. Doing this is a good way to find silence gaps in songs, which make good and safer edit points. As mentioned, you can also make your sound editor "snap" to these zero-crossings for you.
Once you've placed the selection marker at the appropriate position, get the number for it (depending on how you selected and how your sound editor shows you this information) and write it down as the Start Sample. Discard the commas, if any are present. Do the same thing with the End and Loop Samples.
Listen carefully to the sound at these points and see if they're correct. If they are, it's time to use vgm_trim to do the actual trimming. Then you'll have to listen to the trimmed file to check if the file "agrees" that your trims are good.
You may need to repeat the finding process a few times to get good-sounding trim points, so don't be discouraged if your first tries sound funkotronic when actually trimmed. Even veterans can struggle with this. If you're having difficulty finding the right samples, or want more tools in your toolkit, try vgm2txt and vgmlpfnd.
Another method of finding loops which may make it easier can be found in the Manual looping tutorial.
Keep in mind that, as long as it sounds right and it doesn't have excessive information, the trimming is good.