Skip to content

Problems with VGM tools

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

Problems with VGM tools

Post by Random Guy Online »

Hello, I am very very new to Vgmrips, so forgive me if I lack important knowledge

so I downloaded that Nekoproject mod that let's you log VGM files, and it works. However when I try to use tools (such as vgmlpfnd or vgm_trim) I have problems

for example when I use vgm_trim, I get a trimmed file, however when I run the vgm file (for my case in foobar) not all channels are audible, some got muted (or maybe ignored while trimming?)

as for vgmlpfnd, the exe seems to get stuck sometimes randomly and I dont know if thats intentional or not, I am aware of the fact that it may need a lot of time to finish, but when I say it's stuck, I mean it's stuck

I will provide the vgm file I am trying to foll around with as a first attempt of making a proper VGM file, alongside the trimmed one.
Thank you and have a nice day
Attachments
Push'n Pop Stage 10-12_trimmed.vgm
(640.69 KiB) Downloaded 8 times
Push'n Pop Stage 10-12.vgm
(98.48 KiB) Downloaded 9 times
  • User avatar
  • ValleyBell Offline
  • Posts: 4962
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: Problems with VGM tools

Post by ValleyBell »

vgmlpfnd works with the VGM for me. However it is unable to find a loop due to how the sound driver works.

As for trimming, I assume your "Start Sample" was 22664, right?
That is unfortunately too late - you are trimming the part of where it loads the FM instruments.
The optimal start sample is 20817. (about 40 ms earlier)

Especially for FM chips, you can expect that there is a small delay between "sound driver loads instruments" and "you see the first note playing in a WAV editor".
So if you trim by looking at the rendered wave form, you need to go back a bit to keep the "instrument loading" part intact.

(I myself use a rather hacker-style way and make a vgm2txt and then look out for the first spot where the text pattern changes.

Re: Problems with VGM tools

Post by Random Guy Online »

Alright, thanks for telling me trimming problem, now what could I do to find the loop without lpfnd? I think manually looking for it can be very very tedious
  • User avatar
  • ValleyBell Offline
  • Posts: 4962
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: Problems with VGM tools

Post by ValleyBell »

That's how it is then. Just have a look at the Manual looping tutorial and see how far you can get.

Re: Problems with VGM tools

Post by Random Guy Online »

Thanks again for telling me about this. but now I came across with a different problem, the trimmed VGM kinda freaks out at the loop point and after some time it continues. Also I would like to know how to check for the best starting point (because last time it didnt load the instrument and I dont really know how to check for the proper sample as audacity doesnt show anything at 20817)

20817
735614
6652512

late edit I am sure I accidentally passed the sample limit
should log again and let the song play more
which means a diferent start point
Attachments
Push'n Pop Stage 10-12_trimmed.vgm
(651.33 KiB) Downloaded 8 times

Re: Problems with VGM tools

Post by Random Guy Online »

so with some subtractions I found the new start point of the new logged VGM, however, the track seems to loop in a wrong way, when I put exactly what I noted in audacity. yes the rate is 44100 (the song sounds like it loops properly but if you wait few seconds you will see the problem)
Attachments
Push'n Pop Stage 10-12_trimmed.vgm
(700.08 KiB) Downloaded 8 times
  • User avatar
  • ValleyBell Offline
  • Posts: 4962
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: Problems with VGM tools

Post by ValleyBell »

I suggest you always post the untrimmed VGM + the trim values. This makes it easier to suggest "good" values.

In general:
  • You should record at least 2 full loops of the song. This reduces the risk of having to relog the VGM due to the loop ending later than your recording.
    (Also, recording 2-3 loops is a general requirement for the loop finder to have a chance of working, as it searches for repeated data.)
  • The 3 points (sample start/loop/end) are absolute points in time. It is not "difference to X".
    Of course, if your "end sample" exceeds the actual song length, you get hanging notes.
  • I notice that the song is actually an OPN/YM2203 song (uses 3x SSG + 3x FM only and no stereo). You should switch to the PC-9801-26K sound board, so that the logged VGM also uses a YM2203 and not a YM2608.
As for figuring out the starting point, there are basically 2 methods:
  • The "normal user" way: search for where the waveform starts and go back a bit. Use trial and error until it works, going back further when it doesn't.
  • The "hacker" way: dump a txt of the VGM using vgm2txt and watch the patterns of "command" and "delay".
    The initial silence at the beginning should have a very repetitive pattern and that patterns changes when the song starts.
  • In case of this game, there is a small hint at where the actual song starts: The baseline is off at the beginning and gets set to 0 when the song begins. (It starts decreasing at sampel 20818.)
    img.png
    img.png (3.84 KiB) Viewed 264 times
My suggested loop/end points in the trimmed(!) VGM would be:

- loop sample: 652065 (time 14.786 sec)
- end sample: 6088269 (time 2 min 18.056 sec)

This results in a loop of 2 min 3.27 sec length.

Re: Problems with VGM tools

Post by Random Guy Online »

You see, about the starting point. I also check the start and see what you mean, but now that I logged the same song again I took the starting sample again based on what audacity showed me and it didnt catch the part where it sets the instrument like what happened in the first time. Is my audacity messed up, because I see the tutorials (and you possibly) have an older version of it. I also need to say that audacity shows that the song has about 18000000 samples yet vgmtrim said that I put a number higher than the song's length which is really confusing me. Also I am trying to understand what you mean by command and delay in the text file. Sorry for sending everything in attachments, I don't know how to post images like you did above

19116
18000000
18000000
Attachments
Push'n Pop Stage 10-12_trimmed.vgm
(1.77 MiB) Downloaded 6 times
Push'n Pop Stage 10-12.vgm
(1.77 MiB) Downloaded 7 times
vgmtrim output.png
end of wav.png
this.png
  • User avatar
  • ValleyBell Offline
  • Posts: 4962
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: Problems with VGM tools

Post by ValleyBell »

I'm pretty sure that the sample rate set in Audacity is wrong on your side. According to VGMPlay the VGM is 06:32.07 long.
((6*60) + 32.07) * 44100 = 17290287 samples., which is nowhere near 18M.
(The start sample should also be 17557 with a 44100 Hz rate. If I switch to 48000 Hz, I get 19110, which is similar to what you got.)

You need to set the Project Rate to 44100 Hz.
Alternatively, just set your VGM player to use 44100 Hz as output sample rate when dumping the WAV. That way you should avoid most of the hassle.
(The default setting in the last VGMPlay releases has been 48000 Hz.)

btw: The attachments have a button "place inline", which lets you post the images at their respective places in the text.

Re: Problems with VGM tools

Post by Random Guy Online »

I did it! Thank you very much for the help, now I gotta ask about the tags. I heard that you cannot just type the names and stuff and you need to use special characters instead, is this true? Also can I use VGMTool to tag the VGM? (I used VGMTool to trim VGM for game gear games in the past, it cannot work for a VGM like this one but I think it can add tags to it)

Also if you don't know who composed it do you type in the name of the company that made the game (for example Compile)
and when you know the musicians but dont know who composed what, you credit them all?
Attachments
Push'n Pop Stage 10-12_trimmed.vgm
(640.44 KiB) Downloaded 5 times
  • User avatar
  • ValleyBell Offline
  • Posts: 4962
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: Problems with VGM tools

Post by ValleyBell »

Using VGMTool to tag is totally fine. If you use VGMTool to tag the VGMs, you can just type characters in as you want.
If you use the commandline tool "vgm_tag", then Unicode characters don't work and you have to encode them using the "Paste Unicode as HTML NCRs" button in VGMTool.
The main advantage of vgm_tag is batch processing. (i.e. you can just a single .bat file that puts the composer, game and system into all files)

If the actual composer is unknown, leave the field empty. If it a group like "Falcom jdk", then just use that if you don't know the specifics.
If there are multiple composers for the game and you don't have track-specific information, just list all of them in every track.

regarding trimming: I think you should go back about 20 samples from your current starting point just for safety. (The waveform has a small delay due to resampling, I think.)
In any case, your trimmed VGM sounds good now!

Re: Problems with VGM tools

Post by Random Guy Online »

I may do a VGM pack of this game, so you are suggesting me to always make the starta little early, not a problem. I will now upload the finished file so you can tell me is fomething is wrong. Again I appreciate your help
Attachments
Stage 10-12.vgm
(640.61 KiB) Downloaded 5 times
  • User avatar
  • ValleyBell Offline
  • Posts: 4962
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: Problems with VGM tools

Post by ValleyBell »

Looks good to me!

A few things about the tags:
  • VGM creator should be your nickname.
  • Please remove the "Generated by" information from the Notes tag. I recommend to add that information to the txt file instead.
  • If you know the sound IDs or file names of the songs, I recommend to put that info into the Notes tag. (It's just a "nice-to-have" thing though and not a requirement.)
Post Reply