• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

vgmcheck - extract loop point from a VGM file

libertyernie

Smash Ace
Joined
Oct 5, 2009
Messages
929
Location
Eau Claire, WI
The VGM format is the format most often used for storing music from 8-bit and 16-bit Sega consoles, including the Master System and Genesis. Each VGM file has a header containing information about the file, including the total sample size and the loop length. For making BRSTMs from Sega music, this is exactly what we need.
So with Maxim's simple C code and a few Brawl-specific additions by myself, now you can get this looping information from the VGM and get the exact values to enter into the BRSTM converter as well.



vgmcheck comes with the C source code. Included are a Windows binary (compiled with MinGW, so no dependencies!), a helper batch file from drag-and-drop, and a Linux binary.

Download vgmcheck 2.0 Zip archive
You'll probably need Windows to actually convert the VGMs, though.

Steps to use:
1. Install Winamp and the in_vgm plugin.
2. Open Winamp. Press Ctrl+P to open the Preferences dialog. Go to Plug-ins>Input, select in_vgm, and click Configure. Make sure the plugin is set to play the looped portion at least 2 times.
3. In Preferences, go to Plug-ins>Output, select Nullsoft Disk Writer and click Configure. Choose an output location that you can remember (the default is My Music but I change it to my desktop.)
4. Open your VGM file and press Play. Winamp should create a WAV file in the folder you specified.
5. (Optional) Go back in Preferences>Plug-ins>Output and change it back to DirectSound. Only necessary if you want to use Winamp to play music instead of converting it.
6. Open your WAV file in Audacity or another sound editor. Use Tools>Amplify and accept the default value. If you see any clipping (vertical red lines) then undo and go back to Amplify, but lower the dB amount a little.
7. File>Export to a WAV file. You can overwrite the old one if you want to.
8. Drag and drop the original VGM or VGZ onto vgmcheck.bat (or, on Linux, run "./vgmcheck [filename]"). The values we are interested in are the last two - the start and stop points to enter into the BRSTM converter.
9. Launch BCSM-GUI. Convert the WAV file to a BRSTM, entering the start and stop values from vgmcheck.
10. Load the BRSTM into Brawl and play a level with it (since it's mostly Sega music, Green Hill Zone might be fitting.) Congratulations! You have a perfectly looping retro-Sega BRSTM!

Some examples:
Green Hill Zone (Master System) (preview) (from SMS Power!)
Sparkster - Stage 1-1, 1-3 (preview) (from Project 2612)
 

libertyernie

Smash Ace
Joined
Oct 5, 2009
Messages
929
Location
Eau Claire, WI
There's a new version of vgmcheck out. This version adds more info for people who are just using it to get information about the VGM and not hacking Brawl.
Here's an example output (this is Green Hill Zone from the Master System version of Sonic 1):
Code:
--Raw VGM information--
Total samples: 2329215
Total time in mm:ss: 0:52.81
Loop start: 635775
Loop start in mm:ss: 0:14.41
Loop time: 1693440
Loop time in mm:ss: 0:38.40

--For Brawl BRSTM conversion--
Loop start divisible by 14336: 645120
Loop end will then be: 2338560
 

libertyernie

Smash Ace
Joined
Oct 5, 2009
Messages
929
Location
Eau Claire, WI
vgmcheck 2.0 is written in C. Pretty much all the code except the Brawl-specific parts was written by Maxim. I can't tell you how glad I am, because I really don't know much C. Anyways, this means the executable files don't have any dependencies now, which is really nice and makes the program really small.
 

TheUltimateKoopa

Banned via Warnings
Joined
Jun 14, 2010
Messages
3,005
I tried using this, however, when I created a BRSTM using the loop points it said, my BRSTM ended up looping 5 seconds earlier. The VGM was set to 48000 Hz, but it appears vgmcheck assumes 44100 Hz. Is there anyway of adjusting it for different sample rates?

EDIT: I just set the VGM to play at 44100 Hz, but when I used the loop points, it doesn't loop properly.

http://www.brawlcustommusic.com/update/1906
 
Top Bottom