Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - VGM Tools

Reply to topic Goto page 1, 2  Next
Author Message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
VGM Tools
Post Posted: Thu Jul 22, 2010 4:07 pm
Last edited by ValleyBell on Sat Jun 08, 2013 6:48 pm; edited 14 times in total
Important note: These tools are outdated. You can find the most recent versions on vgmrips.

During the last months I wrote some vgm tools.
Some are less useful when dealing with vgms v1.50 and earlier because VGMTool does well with them.

Here's the list:
- vgm_cmp: VGM Compressor (should maybe called Optimizer)
- vgm_facc: Make VGM Frame Accurate
- vgm_smp1: Remove 1 Sample Delays (useful for NPGC vgms)
- vgm_sptd: VGM Splitter (split by delay)
- vgm_spts: VGM Splitter (split by sample)
- vgm_trim: VGM Trimmer
- vgm2txt: VGM Text Writer
- vgmlpfnd: VGM Loop Finder
- dro2vgm: DosBox RAW OPL -> VGM Converter
- vgm_sro: VGM Sample-ROM Optimizer
- optvgmrf: VGM RF-PCM Optimizer
- vgmmerge: VGM Merger
A Readme is included with a short description for each tool.

The tools vgm_ptch, vgm_tag and vgm_stats can be found here.

And finally I updated Paul Jensen's vgm2mid to support dual chips as well as NGP's PSG chip. Trimming is a lot easier to do with midis than with waves so I use this very often.

I can upload the sources on request.

Have fun!

EDIT: I had to do a small bugfix in vgm_trim.
EDIT2: Updated vgm_cmp to support OPN-chips (YM2203, YM2608, YM2610, YM2612).
Updated FindEquality to support YM2612 with DAC.
Added dro2vgm.
Improved vgm2mid's YM2608/YM2610 ADPCM support.
EDIT3: Added vgm_sro.
EDIT4: Updated vgm2mid.
New features: OPL4 support (thanks to Linux' OPL4 Driver), option to loop vgms
EDIT5: Updated vgm_sro to fix YM2608/10 DELTA-T bug.
Updated all tools to be batch-friendly.
EDIT6: Moved vgm_stat to the wiki.
Renamed vgm_splt to vgm_sptd (mills requested an alternative splitting tool).
Updated vgm_trim to rewrite rarely sent commands. See readme for more info. (Although the source got 15 KB -> 31 KB, the exe has still 20 KB.)
EDIT7: Added vgm_spts. All splitting tools now use the safer trimming code from vgm_trim.
EDIT8: Added Y8950 support to vgm_sro and AY8910 support to vgm_cmp.
EDIT9: Rewrote FindEquality and renamed it to vgmlpfnd, added optvgmrf
I did a lot more updates, but they are too many (and I already forgot some).
EDIT10: Cool! The number of edits is 2-digit-long!
Added vgmmerge and the source code of all tools.
EDIT11: vgmmerge can now merge 3+ chips! (and minor updates to dro2vgm and optvgmrf)
EDIT12: improved and fixed optvgmrf, added some chips to vgm_sro and improved vgm_cmp
EDIT13: Added YMF271 to vgm2txt, fixed optvgmrf, improved trimming of OPL chips, fixed some commands in vgm_cmp, improved vgmlpfnd
EDIT14: Made source compatible with 64-bit compilers, fixed crash with vgm v1.61 files, added GB DMG and NES APU, many other fixes - see this post for details
EDIT15: Added link to vgmrips.
vgm2mid.rar (119.54 KB)
VGMTools.rar (115.3 KB)
VGM Tool Collection
VGMTools_src.rar (128.36 KB)
VGM Tool Collection source

  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Tue Aug 10, 2010 8:12 pm
I made some updates and added a new tool. For more information see "EDIT2" above.

EDIT: Just wanted to say that again for those who don't read ReadMe-files:
When vgm_facc displays
Maximum Rounding Difference:
   -367 at 00049F
   367 at 0004EB

it wants to say: DON'T round to frames.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Thu Aug 19, 2010 9:44 pm
I added another tool: vgm_sro.
It strips all unused data from Sample-ROMs. It's very useful for vgms that use the YM2608 or YM2610 chip.

Does anyone know a game that has uses DELTA-T PCM chip? It's a part of YM2608, YM2610 and Y8950 sound chips, but most games don't use it.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Aug 2010
  • Posts: 38
Reply with quote
cool!
Post Posted: Tue Aug 24, 2010 4:19 pm
This vgm tools are cool! Vgm_sro works very well.

Metal slug x uses the delta T, this is part of the vgm_sro output:

ROM Region List
---------------
From To Length Status
YM2610 ADPCM
000000 01FEFF 1FF00 unused
01FF00 0237FF 3900 USED
---
-
YM2610 DELTA-T
000000 5588FF 558900 unused
558900 5678FE EFFF USED
--
-

Original vgm was 20 MB and the optimized is 2 MB.

vgm_sro worked very well with other neo geo roms (Viewpoint, Spin Master...).

Edit: viewpoint also uses delta T in some tunes, Stage 1 was 8MB and the optimizd is 230 Kb. I think stage 1 is the best song, I'll try to rip the rest.
Viewpoint_Stage1.vgm7z (143.32 KB)

  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed Aug 25, 2010 8:27 am
Thanks for the nice song. I'll use it to check VGMPlay and vgm_sro.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Re: cool!
Post Posted: Thu Aug 26, 2010 5:16 pm
Thanks to mills I noticed and fixed a small bug of vgm_sro.

mills wrote
YM2610 DELTA-T
000000 5588FF 558900 unused
558900 5678FE EFFF USED

The block length of used data was off by one. (0xEFFF should be 0xF000) I fixed that.
And it's now safe to open an optimized vgm with vgm_sro again. (e.g. to view the used amount of data)

@mills: If you already optimized some vgms with delta-t you can post them and I'll fix them.
  View user's profile Send private message Visit poster's website
spot
  • Guest
Reply with quote
Post Posted: Thu Sep 09, 2010 3:28 am
Yes please, i'd be interested in seeing the sources released! =)
 
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed Sep 15, 2010 2:16 pm
I did an important update to vgm_trim. The ADPCM of mills' Shin Chan tune works now.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Aug 2010
  • Posts: 38
Reply with quote
Post Posted: Wed Sep 15, 2010 7:17 pm
Thanks a lot! I'll upload a pack of the shinchan game, people will like the funny tunes :).
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Mon Dec 20, 2010 1:57 pm
I did many updates. The most important is, that I've rewritten the Loop Finder - now it's 10-100 times faster than the old one.
others are:
- vgm_sro: YMZ280B support
- vgm2txt: OPN-support and some bugfixes
- some others that I forgot already
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Fri Dec 31, 2010 3:05 pm
I wrote another tool: the VGM Merger. And I uploaded the source of the tools.

I attached some examples for and made with the VGM Merger.
Ever wanted a vgm with YM2413 and YM2612? Nothing easier than that. I already attached one.

Enjoy the songs!
MergeExamples.rar (18.49 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1355
  • Location: italy
Reply with quote
Post Posted: Fri Dec 31, 2010 4:02 pm
Ha, I was about to work on something similar soon, you beat me on this :)

Awesome work, as always. It's good to hear a multi-FM vgm file at last :)

Bonus point for using my converter for the 2612 part of the sample file :D

(also I noticed you didn't blank out the GD3 tag of the merged file, which still seems to be "Converted from a midi file with nineko's midi2vgm")
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Mon Jan 10, 2011 4:03 pm
Tom wrote
Ha, I was about to work on something similar soon, you beat me on this :)

Awesome work, as always. It's good to hear a multi-FM vgm file at last :)

Bonus point for using my converter for the 2612 part of the sample file :D

(also I noticed you didn't blank out the GD3 tag of the merged file, which still seems to be "Converted from a midi file with nineko's midi2vgm")

Thanks. (and special thanks for the bonus point :)
And that GD3 tag was intentional. (It uses the GD3 of the second file, if the first doesn't have one.)

I did some updates:
- vgmmerge can now merge 3+ files by using a new commandline option. (expect some messages if you enter unusual values)
- optvgmrf doesn't anymore destroy the RAM dump at the start of a vgm and can now detect, if an optimization is possible.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Fri Feb 18, 2011 6:20 pm
I did a lot of work on vgm_sro and vgm_cmp and some work on optvgmrf.
- added SegaPCM, RF5Cxx and YMF271 support to vgm_sro
- added YMF271, improved RF5Cxx and YM2612 support in vgm_cmp (it can now strip YM2612's frequency-commands - very compicated to handle)
- added multipass-compression to vgm_cmp (compressing vgms with a RF5Cxx 2 times sometimes makes them even smaller!)
- improved optvgmrf and fixed some bugs
- I changed some small things in the trimming-routine of vgm_trim/vgm_sptd/vgm_spts, but I don't know anymore
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed May 11, 2011 10:06 am
During the last months I did some fixes. The last two were discovered just some days ago and are the only really important ones.
- vgm2txt: YMF271 support added
- vgm_cmp: YMF278 write and DAC Control commands were handled incorrectly
- vgmlpfnd: better support for RF5Cxx, PWM and YMF271
- added vgm_dbc (VGM Data Block Compressor) - will be very useful for PWM streams when I finish optvgm32
- optvgmrf bugfix: step 1 killed loop offset (and didn't even show an error or warning)
- all trimming tools (vgm_trim, vgm_spt?): improved/fixed trimming of OPL chips

I also made a topic on Project2612 where I described how some of my tools work.
  View user's profile Send private message Visit poster's website
  • Joined: 13 Jun 2011
  • Posts: 8
Reply with quote
Post Posted: Tue Jun 14, 2011 5:58 am
Please, ValleyBell, where I can find the complete list of chips that your tool "vgm2mid" support ?
I'm trying to convert two *.vgm files-tracks (AY8910) generated by your VGM-M1(mame-arcade) from a Bomb Jack's game song to one MIDI file with no success...
Maybe I need to merge first in one VGM... maybe vgm2mid not support that AYchip?
Great Work, Thanks!!!
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed Jun 15, 2011 8:30 am
vgm2mid chip list - good question.
There is no real list, but the update readme lists all chips I added since v0.4 (which supported the PSG, YM2413 and YM2612).
Currently all these chips are supported:
SN76489 (PSG), T6W28, YM2413, YM2612, YM2151, SegaPCM (OutRun drums only), YM2203, YM2608, YM2610, YM3812 (AdLib), YM3526, Y8950, YMF262 (OPL3), YMF278

Sorry, currently there's no AY8910 support.
But I'll add it when I work on it the next time.
  View user's profile Send private message Visit poster's website
  • Joined: 13 Jun 2011
  • Posts: 8
Reply with quote
Post Posted: Wed Jun 15, 2011 11:50 am
Last edited by RockRiver on Wed Jun 15, 2011 12:15 pm; edited 1 time in total
Yes!! please, AY8910 & YM2149 ... vgm2mid support

Thank you, ValleyBell, for your answer Maybe these links and persons can help you:

-YM file: http://leonard.oxg.free.fr/ymformat.html

-AY spectrum guru: http://bulba.untergrund.net/main_e.htm and his AY-YM player http://bulba.untergrund.net/emulator_e.htm would he update his player to support your VGM works...

-YM2MID util from Oedipus : http://fading-twilight.atari.org/fading_twilight_excerpt_07/PLAYER/WINDOWS/YM2MI...

-Incredible sound chips emu software: PLogue's ChipSound soft-synthesizer: http://www.plogue.com/?page_id=43

http://ploguechipsounds.blogspot.com/2009/10/full-ay-emu-prototype.html
  View user's profile Send private message
  • Joined: 13 Jun 2011
  • Posts: 8
Reply with quote
Post Posted: Wed Jun 15, 2011 12:07 pm
I discovered recently [Non Sega 8-bit VGM Pack]s from Kaminari, ValleyBell & Sonic of 8!
Because I am a MIDI musician I like to transform that VGMs to MIDI to assign different instruments and samplers with MIDI sequencer:
Out Run played by a sampled Funk Band or Arkanoid player by Symphony Orchestra... Yeahhh!!!!

But vgm2mid doesn't work with these VGM compressed files... I need to make a new uncompressed files?

My intention is to make new [Non Sega 8-bit VGM Pack]s from Arcade with the addition of MID files inside the folder too.
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed Jun 15, 2011 12:36 pm
Compressed vgms actually "work", but only if their extention is vgz.
Just rename all compressed .vgm files to .vgz and it works.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14685
  • Location: London
Reply with quote
Post Posted: Wed Jun 15, 2011 2:24 pm
All VGM tools should support compression by using the gzio libraries which support both compressed and uncompressed files directly.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed Jun 15, 2011 8:42 pm
"should" is right
vgm2mid currently uses gzip.exe to decompress vgz-files so it can load uncompressed vgms.

Although I changed quite a lot in vgm2mid, I barely touched the loading routine. (just some small bugfixes to make decompressing work more often)
I'll compile a VB-compatible zlib and will rewrite the loading routine in some future version.
  View user's profile Send private message Visit poster's website
  • Joined: 13 Jun 2011
  • Posts: 8
Reply with quote
Post Posted: Thu Jun 16, 2011 11:25 am
ValleyBell wrote
Compressed vgms actually "work", but only if their extention is vgz.
Just rename all compressed .vgm files to .vgz and it works.


Out Run's "Splash Wave" Works!!!! fine.
Now I'm editing MID file with Cakewalk Express (Lite Midi Easy Version): Instruments, Midi Channels, File's Info...

vgm2mid choose Ok Midi instruments, info for that is in YM2151 code? or in vgm2mid options?... I will try with others songs. And attach here examples *.MID editions
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1355
  • Location: italy
Reply with quote
Post Posted: Sun Jun 19, 2011 1:30 am
vgmmerge crashes on me every time I try to open a vgm file with it :(
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Sun Jun 19, 2011 8:52 am
You know, many programmers forget to free their memory.
Well, funnily I did the opposite - I forgot to allocate some. (I introduced the bug when I made it possible to merge more than 2 files.)

I attached a fixed version.
vgmmerge.zip (4.67 KB)
fixed VGM Merger

  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1355
  • Location: italy
Reply with quote
Post Posted: Sun Jun 19, 2011 12:20 pm
Thanks. Sadly this didn't turn out as good as I wanted to, but it's not too bad for my first YM2413+YM2612+SN76489 attempt :)

edit: with some other songs I get this:
Error! Allocated space too small!01369F / 00441E09) ...
Please report this bug.
I got it while merging a 2612 and a 2151 vgm files. Interestingly enough, once I unoptvgm'd both of those files, they could be merged just fine. Probably you're not allocating enough memory if the source files are smaller than what they're supposed to be once uncompressed...
In other news I found out that Arcade Outrun (2151) and Genesis Outrun (2612) have slightly different tempos, which is sad, because the few seconds of Magical Sound Shower that actually overlay sound awesome :(
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Sun Jun 19, 2011 7:41 pm
The problem are the 0x8? commands. None of my tools can handle them well. (My problem is, that the command is a DAC write followed by a delay, not the other way, which makes them hard to handle.)

Look at some commands of the OutRun MD vgm:
82 83 82 83 83 82 82 83
And this is how vgmmerge writes them:
80 71 80 72 80 71 80 72 80 72 80 71 80 71 80 72

As you can see, vgmmerge (and most of my other tools) "decompresses" the commands - that doubles the file size.
vgmmerge only allocates space for (file size1 + file size 2 + 0x100), so that's clearly not enough.

At least I was smart enough to display a message instead of letting it crash. :|

I will take some time (more or less soon) and fix the 0x8? command handling in all tools.
But thanks for the report.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1355
  • Location: italy
Reply with quote
Post Posted: Tue Jun 28, 2011 1:00 pm
Out of curiosity, how do you make a 2x(same chip) vgm with vgmmerge? I tried to merge two SN76489 vgm files, with the result that they were interfering with eachother. Same result with two YM2612 vgm files. I thought the new vgm specs allowed for multiple chips of the same kind?
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed Jun 29, 2011 7:22 pm
Tom wrote
Out of curiosity, how do you make a 2x(same chip) vgm with vgmmerge?
That's easy to answer - you can't.
But the idea is nice - I noted it. And btw, vgmmerge can now merge v1.50 optvgm files.
I'll implement the better 0x80 handling in the other tools and then I'll update the tool package.
  View user's profile Send private message Visit poster's website
  • Joined: 31 Oct 2007
  • Posts: 853
  • Location: Estonia, Rapla city
Reply with quote
Post Posted: Wed Jun 29, 2011 8:57 pm
Supporting multiple chips of same kind is a requirement to support sound of my music computer in VGM. It uses YMF278 and 3xYMF288 or YMF276 and YMF701/711/713/715/718/719 which means 2x OPL3 chips, 24 PCM channels and 3x OPN chips
  View user's profile Send private message Visit poster's website
  • Joined: 11 Aug 2011
  • Posts: 4
Reply with quote
Post Posted: Thu Aug 11, 2011 5:17 pm
Excuse me for being such a noob, but I am having some issues compiling your tools on linux... Heres what I get.

learnerofskills@File-Island ~/VGMs/VGMTools_src $ gcc vgm_cmp.c
vgm_cmp.c:8:19: fatal error: conio.h: No such file or directory
compilation terminated.


After some googling I've found out that conio.h is windows specific... so does that mean these apps wont compile on linux?
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Fri Aug 12, 2011 7:41 am
You're right, I'm using windows-specific headers.
But they're used only for progress display and waiting for a keypress, so that the console stays open if someone makes a double-click or uses drag and drop on it.

If you comment the windows-headers (conio.h and windows.h), the _kbhit(), _getch() lines and the if (CmdTimer < GetTickCount())-block out, it should work.
  View user's profile Send private message Visit poster's website
  • Joined: 13 Nov 2007
  • Posts: 93
  • Location: New York, NY, USA
Reply with quote
Post Posted: Fri Aug 12, 2011 6:24 pm
i can confirm that commenting out what VB suggests makes compilation work on a mac (snow leopard 10.6.8); i've only tried it on vgm2txt with the following command, but i'm sure it'll work w/the others and their appropriate includes:


prompt> gcc -Wl,-lz -o vgm2txt chiptext.c vgm2txt.c


the -Wl,-lz (both "ell") is so gcc links your already installed system version of zlib.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Aug 2011
  • Posts: 4
Reply with quote
Post Posted: Fri Aug 12, 2011 10:21 pm
so after I edit the c files and type in the command, I get this error... and the c file also disappears from my directory.

learnerofskills@File-Island ~/VGMs/VGMTools_src $ gcc -Wl,-lz -o vgm_dbc.c
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Sat Aug 13, 2011 2:14 pm
The syntax is "... -o output_file input_file ...", so you're attempting to compile into vgm_dbc.c (-> you overwrite the c-file).

Also: You're trying to compile it with 64-bit. That'a a bad idea, because the long int type has 64-bit on x64 compilers and only 32-bit on x86 compilers. (And I always use long int for 32-bit integers.)
That's also noted in SourceReadme.txt.

Please wait a week and I'll update the tools with x64-compatible versions. (I need to update them either way as every single tool crashed when I tried to open vgm v1.61 files.)
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Fri Aug 19, 2011 1:07 pm
As promised, here are the updates.
Because I really couldn't remeber what I did over 3 months, I compared old and new files, so this time the update list is very detailed.

Updates (in no particular order):
- sources were cleaned a little and are now compatible with 64-bit compilers (and most tools should compile on Linux without modification)
- the tools don't crash anymore, if the VGM header has more than 128 bytes (needed for compatibility with v1.61 vgms)
- vgm_cmp: added support for GameBoy DMG and NES APU
- vgm_cmp: slightly improved compression of YM2151 and RF5Cxx, improved compression of YM2203, YM2608, YM2610
- vgm2txt: fixed output for OPL register C0, added GameBoy DMG and basic NES APU support
- vgm2txt: added header values for PSG Flags, AY8910 clock/flags, Volume Modifier, Loop Base + Modifier, GameBoy DMG, NES APU
- dro2vgm: fixed to work with latest version of the VGM header file.
- vgm_spts: -1 can now be used to write the rest of the vgm
- vgm_cmp and vgmmerge can now write the commands 0x80 to 0x8F (instead of 0x80 + 0x7x)
- vgm_trim*: improved vgm-init for YM2151, RF5Cxx chips, all OPL chips, added GameBoy DMG
- vgm_trim: fixed possible crash with RF5Cxx handling, added Stream Control commands
- vgm_trim: fixed crash that can happen when Start Sample = Loop Sample and Start Sample is in the middle of a delay
- vgmlpfnd: improved search with OPL chips and YMZ280B
- vgmmerge: added GB DMG and Stream Control support, improved header merging, fixed a potential crash related to large GD3 tags
- renamed VGMPlay.h to VGMFile.h, added stdtype.h
* vgm_trim includes vgm_sptd and vgm_spts

Note: The readme already mentions the "-nodual"-switch, but dual-chip-support isn't yet implemented, so it doesn't do anything.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Aug 2011
  • Posts: 4
Reply with quote
Post Posted: Thu Aug 25, 2011 11:13 am
They still don't compile on linux... it looks like you forgot to put #ifdef WIN32 before the GetTickCount block.

gcc complains (but still compiles) about 'gets' being unsafe. So instead I replaced them with 'fgets(FileName, 256, stdin);'

gcc also seems to complain a lot about 'INT32' and 'UINT32', and will often say it expects 'long unsigned int' 'long int' or 'unsigned int' instead

Although those were the most common errors I got, a few of the tools had more issues. Since I'm not a coder and I don't really know how to fix them, I attached some of my compilation errors here.

  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Sat Aug 27, 2011 12:25 pm
Here - try this.
I think I got all GetTickCount-blocks now. (I forgot about them after 1 hour of cleaning the code and inserting #ifdef WIN32s)

And vgm_vol wasn't meant to compile under Linux, because the directory listing works with Windows APIs. It should compile now, but will only support m3u playlists.

I know that gets is unsafe and fgets may be the better way, but I'm too lazy to remove the stupid 0x0A-character fgets appends.
About the INT32/UINT32 warnings: They'll remain until I take another hour to fix them. (It works with 32 bit compilers.) They're only doing all text output in vgm2txt and some unimportant progress display.
VGMTools_src_fix.rar (52.27 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 11 Aug 2011
  • Posts: 4
Reply with quote
Post Posted: Mon Aug 29, 2011 12:15 pm
Thank you. These will all compile (with warnings, but they compile) except for dro2vgm, vgm2txt, vgm_facc, and of course vgm_vol.

I am searching for another game to try them out on.
  View user's profile Send private message
  • Joined: 28 Oct 2011
  • Posts: 23
  • Location: Ethereal Plane
Reply with quote
Post Posted: Sat Oct 29, 2011 8:30 am
Last edited by Wraithverge on Wed Nov 02, 2011 7:12 am; edited 1 time in total
Hello, everyone!

ValleyBell, it is very refreshing to see a fellow musician developing the old and new tools for the VGM format. Thank you very much for sharing your efforts with all of us! I must say, your work over the past few years is nothing short of amazing, and I'm beginning to think that you might actually be an Android in disguise. ;)

OK, I contributed to the in_adlib and DRO2MIDI projects last year, so, I thought you might be interested in some insight I have about the DRO format in relation to your dro2vgm tool. Are you aware that when some OPL captures get recorded in DOSBox (all DRO revisions) they can have a delay before the music starts to play? It's quite rare, but, it does happen occasionally within certain songs (I still don't know exactly why, though). Well, if you (or anyone else) would like to hear and see an example of what I'm talking about, then please check out this 2nd tune that I corrected recently.

Your dro2vgm tool calculated exactly what the true time-length (in ms.) of the song should be after the hacks were done, therefore, I personally thank you for your indirect help with that much needed information! :)

On another note, I am wondering: Is there still a chance that you might add support for the "Hudson's HuC6280 PSG (used in PC Engine/TurboGrafx-16)"? The reason I ask is, because, I have been wanting to convert native HES data to MIDI for years (especially the Neutopia I & II soundtracks), and with Mr./Ms. GIGO out of the scene, I had lost all hope of it ever being possible without sequencing the songs entirely by ear-and-hand.

By the way, I have had one exception thus far, where I could not convert a song that I really like from the HES version to MIDI: I worked from a very thin GBA rendition (generated by Sappy 1.6, after I hacked into the list of supported games) to make it sound much closer to the PC-E version (i.e., in Darius Plus). If someone might be interested in hearing a sample of my art, then please check out this rendition. Please look at the TAG info for more details about this particular edition of the song ...

About vgm2mid: I don't think anyone has mentioned this to you here at SMSPower: When I beta-tested your edition of vgm2mid in January 2011 on my Win98SE drive, I noticed that the elements on one of the control panels were not positioning properly (I'm sorry, but, I can't remember exactly which panel it was). The screen resolution was set at 640x480 16-Bits color, although, I doubt that was the actual reason for the problem. I would have tried to fix it myself, but, that Visual Basic app doesn't have dialogue resources in its .rsrc section. However, if you are already aware of this issue and have already fixed it, then please disregard this report.

Oh, and I am also wondering: Why do you not 'version' your own projects? Do you rely solely on the date/time to keep track of changes in your work? ("Version Numbers"!? Androids don't need no stinking Version Numbers! ;-) )

Peace, y'all!
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Sat Oct 29, 2011 10:46 am
I know this DRO bug very well - it's only present in DRO v1. (see DRO Format)
You know that command 01 is a delay? Do you know that the OPL chip uses register 01 to enable additional waveforms?
The problem is that the DOSBox developers forgot to write the command 04 ("do register write 00-04"). So it writes 01 20 (wave enable) instead of 04 01 20.
dro2vgm and VGMPlay both do checks to hande 01 20 as register write rather than a delay.

[btw: You aren't penalized for being new. That is to prevent spambots from spamming the forums.]

The HuC6280 will be included in the next vgm version.

vgm2mid: I think there was some problem with the loop option or so. I noticed and fixed it some time ago. (I think I noticed it in Win95, but I have a Win98SE on another computer, so I can try it there.)

About version numbers: I was just too lazy to version the tools. (and tools like dro2vgm never get real updates, only fixes)
I add version numbers to some tools, (vgm2mid, smps2mid, mid2smps, some private ones) but I don't add them to others. (like most vgm tools - noting 'works with vgm version 1.xx' is usually enough)
  View user's profile Send private message Visit poster's website
  • Joined: 25 Jun 2005
  • Posts: 50
  • Location: Paris, France
Reply with quote
Post Posted: Sat Oct 29, 2011 2:55 pm
Ah, can't wait for HuC6280. Will you eventually support the Oki MSM5205? (This chip is present in the CD-ROM expansion units and provides an additional ADPCM channel to the PC Engine.)
  View user's profile Send private message Visit poster's website
  • Joined: 21 Jun 2010
  • Posts: 200
  • Location: Earth Planet
Reply with quote
Post Posted: Sat Oct 29, 2011 6:48 pm
One thing that might is impossible logical is adding CD/DA support.
  View user's profile Send private message
  • Joined: 25 Jun 2005
  • Posts: 50
  • Location: Paris, France
Reply with quote
Post Posted: Sat Oct 29, 2011 8:01 pm
Why would you want to log CDDA in VGM? @_@;)
  View user's profile Send private message Visit poster's website
  • Joined: 21 Jun 2010
  • Posts: 200
  • Location: Earth Planet
Reply with quote
Post Posted: Sat Oct 29, 2011 8:34 pm
Kaminari wrote
Why would you want to log CDDA in VGM? @_@;)


It's a joke only!
  View user's profile Send private message
  • Joined: 28 Oct 2011
  • Posts: 23
  • Location: Ethereal Plane
Reply with quote
Post Posted: Sun Oct 30, 2011 1:50 am
Last edited by Wraithverge on Wed Nov 02, 2011 6:33 am; edited 1 time in total
Sonic of 8! wrote:
"It's a joke only!"

Yeah, that is about as silly as this: VGM Specification 10.0, now featuring support for 5.1 channel Surround Sound! ;-) (Not going to happen ... ever.)

ValleyBell wrote:
"I know this DRO bug very well - it's only present in DRO v1."

Nope, your statement appears to be incorrect ;) : The problem also happens with the new-and-not-so-improved v2 DROs, too, the 'result' is just a bit different, that's all. If you run the HYBRID.EXE (that is included in the archive) within DOSBox 0.74, and then try to capture the OPL commands, it will still cause a delay, however, unlike with the v1 DRO, the v2 DRO will initialize at a few bars into the song when it starts to play, instead of starting from its beginning. So, the v2 DRO is actually affected worse than v1.

ValleyBell wrote:
"You know that command 01 is a delay? Do you know that the OPL chip uses register 01 to enable additional waveforms? ..."

Yes, and yes ...

ValleyBell wrote:
"... The problem is that the DOSBox developers forgot to write the command 04 ("do register write 00-04"). So it writes 01 20 (wave enable) instead of 04 01 20. ..."

You're right, the first two data-bytes of these errant captures is always 01 20. Yes, the Registers do not get set-up properly at initialization; that's a big part of the problem. Your explanation here makes reasonable sense for v1 DROs, but not so much for the v2 DROs -- This issue was supposed to get fixed in that upgrade, but, now I've got two examples in which show that is not truly the case.

ValleyBell wrote:
"... dro2vgm and VGMPlay both do checks to [handle] 01 20 as register write rather than a delay."

Oh, wow, I did not know that fact! How about vgm2mid, does it do the fix-ups, too, or would we still need to correct the DRO-file first before converting it into a VGM-file?

By the way, there is a recent utility available for WinXP or higher named "DRO Trimmer" that uses the Python run-time environment. However, since I already know how to fix this sort of file manually, I haven't actually tried using it yet (and, I do tend to agree with your philosophy that it is much easier to 'trim' the end of a resulting MID-file than (in this case) a DRO-file).

ValleyBell wrote:
"The HuC6280 will be included in the next vgm version."

Alright, great! :-) -- I've waited this long for something like it, so, no problem, I can easily wait however much longer it takes for you to deal with its details.

ValleyBell wrote:
"vgm2mid: I think there was some problem with the loop option or so. I noticed and fixed it some time ago. (I think I noticed it in Win95, but I have a Win98SE on another computer, so I can try it there.)"

Belay doing that just yet, please, I've just tested the vgm2mid 08/23/2011 edition here on WinXPPro, and its doing the exact same way as it did on Win98SE. Yep, the area within the group-box for "Looping VGMs" is being drawn on top of the "Patch Changes" group-box of the YM2413 panel. The affected area is registering as being 'solid', so, I cannot interact with the drop-down menu directly beneath it. Hmmm, it appears to be redrawing just those particular objects (including the edit-box and strings) globally across all five pages, so, perhaps you'll need to somehow exclude that main object from being drawn on that one particular page.

ValleyBell wrote:
"I add version numbers to some tools, (vgm2mid, smps2mid, mid2smps, some private ones) but I don't add them to others. (like most vgm tools - noting 'works with vgm version 1.xx' is usually enough)"

Okay, sure, a notification like you describe probably is sufficient enough, and so is versioning by date, but only if you store the string somewhere internally.

Hey, ValleyBell, has anyone ever told you that your name has a nice 'ring' to it? :-)
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Tue Nov 01, 2011 10:04 pm
Wraithverge wrote
If you run the HYBRID.EXE (that is included in the archive) within DOSBox 0.74, and then try to capture the OPL commands, it will still cause a delay, however, unlike with the v1 DRO, the v2 DRO will initialize at a few bars into the song when it starts to play, instead of starting from its beginning. So, the v2 DRO is actually affected worse than v1.
That's not exactly true. The offical DOSBox 0.74 records only a small delay.
But my mod starts recording instantly (like all emulators with vgm support). The offical DOSBox on the other side sometimes misses drum intros that only use the rhythm channel.

Wraithverge wrote
How about vgm2mid, does it do the fix-ups, too, or would we still need to correct the DRO-file first before converting it into a VGM-file?
vgm2mid can only convert vgms and dro2vgm does the fixes, so vgm2mid needs no correction.

Wraithverge wrote
I've just tested the vgm2mid 08/23/2011 edition
I'm sure you mean 08/23/2010.
I uploaded a newer but WIP version some weeks ago and posted the link in a thread on Sonic Retro about BPM and VGM. It's from May 2011 and is fixed and has some nice tempo adjustment options.
After finishing in_vgm 0.40 I'll work on it, but in_vgm is currently more important.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Oct 2011
  • Posts: 23
  • Location: Ethereal Plane
Reply with quote
Post Posted: Wed Nov 02, 2011 4:34 am
ValleyBell wrote:
"That's not exactly true. The offical DOSBox 0.74 records only a small delay. ..."

Yes, you're exactly right. I really should have wrote that out as "it will still cause a small delay", because, that is what I was implying there. ;)

ValleyBell wrote:
"... But my mod starts recording instantly (like all emulators with vgm support). The offical DOSBox on the other [hand] sometimes misses drum intros that only use the rhythm channel."

Yes, I neglected to mention here the fact that the delayed DRO-example I provided to you was captured with a personally-modified private build of DOSBox 0.72. This particular source-mod was built including an unofficial patch of which Malvineous submitted to the DOSBox authors, and that patch is supposed to fix exactly what you've described there about the Drum intros. BTW, the patch that I'm referring to was supposedly included along with the other improvements for DRO v2, but, I haven't been able to verify if either one's actually fixed or not.

Hmmm, I'm very interested to further study the changes you've made to the source of DOSBox 0.74, for me to understand their differences better without my having to bother you about it directly. I hope that I'm not out-of-line by asking you this question, but, could you please also provide to us a difference patch with the changes you've made against the official DOSBox 0.74 sources? (If you'd rather not share it with the general public, then, I give you my word as a gentleman that I would keep it all strictly confidential -- You can find my address in the latest in_adlib 1.8.2 release)

ValleyBell wrote:
"vgm2mid can only convert vgms and dro2vgm does the fixes, so vgm2mid needs no correction."

Ah, I see ... Thank you for clarifying that better, because, I initially wasn't quite sure if you meant that the fixes are done temporarily at run-time (e.g., within VGMPlay) or are permanently patched into the resulting VGM-file (e.g., within dro2vgm).

ValleyBell wrote:
"I'm sure you mean 08/23/2010. ..."

[checking] Yes, you're right about the year I reported as being off-by-one -- I'm very sorry about that mistake. ;-\ (only human + lack of sleep = prone to subtle errors)

ValleyBell wrote:
"... I uploaded a newer WIP version some weeks ago and posted the link in a thread on Sonic Retro about BPM and VGM. It's from May 2011 and is fixed and has some nice tempo adjustment options."

Oh, okay, it's no wonder I was so confused, then -- You see, I very recently (re)downloaded the "vgm2mid.rar" in your MF folder thinking it was the latest edition. However, I wasn't aware of this other thread you mention there (I'll go find and read it shortly).

Anyhow, yes, this newer edition is definitely fixed in regard to the error I reported to you, and the new options you mention do look very interesting as well. I've got about ~50 songs in my current music project that I plan to work on soon with the help of vgm2mid, so, hopefully in the near future I'll be able to let you know about my full experience with this new edition, be it good or bad.

ValleyBell wrote:
"After finishing in_vgm 0.40 I'll work on it, but in_vgm is currently more important."

No problem, I understand the situation. Anyway, vgm2mid seems to be good-to-go for now, since you've already fixed that one known issue. Unless there is something else that we're not aware of yet, you probably shouldn't need to do anything else to it for a while. Currently it has plenty enough revised/additional functionality to keep a person like me (i.e., a seasoned Musician) busy for quite a long time.

BTW, ValleyBell, I hope that you haven't taken any offense from my kidding you with jokes, because, I'm just trying to be friendly and help 'lighten the atmosphere' around here a little bit, that's all. ;) (It's just unhealthy for us to be so serious all of the time)
  View user's profile Send private message
  • Joined: 15 Sep 2009
  • Posts: 377
Reply with quote
Post Posted: Wed Nov 02, 2011 7:23 pm
Wraithverge wrote
Hmmm, I'm very interested to further study the changes you've made to the source of DOSBox 0.74, for me to understand their differences better without my having to bother you about it directly. I hope that I'm not out-of-line by asking you this question, but, could you please also provide to us a difference patch with the changes you've made against the official DOSBox 0.74 sources?
I uploaded the DOSBox source to Mediafire earlier today. You find it in the emulator folder. (I usually release all my source changes, but I was lazy when I released my DOSBox mod.)

Wraithverge wrote
I initially wasn't quite sure if you meant that the fixes are done temporarily at run-time (e.g., within VGMPlay) or are permanently patched into the resulting VGM-file (e.g., within dro2vgm).
That's because I do them both, permanently and temporarily. VGMPlay has native support for DRO files. (but it's DRO v1 "bug finder" is not as good as the one in dro2vgm)

Wraithverge wrote
BTW, ValleyBell, I hope that you haven't taken any offense from my kidding you with jokes, because, I'm just trying to be friendly and help 'lighten the atmosphere' around here a little bit, that's all. ;) (It's just unhealthy for us to be so serious all of the time)
That I don't comment on the jokes doesn't mean that I don't like them. (In fact I smiled quite a lot.)

And btw:
Wraithverge wrote
Yeah, that is about as silly as this: VGM Specification 10.0, now featuring support for 5.1 channel Surround Sound! ;-) (Not going to happen ... ever.)
Are you really that sure about that? :)
When I have quite too much time and feel like coding crazy things, I may add 4 channel panning options.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Oct 2011
  • Posts: 23
  • Location: Ethereal Plane
Reply with quote
Post Posted: Thu Nov 03, 2011 12:55 pm
ValleyBell wrote:
"I uploaded the DOSBox source to Mediafire earlier today. You [can] find it in the emulator folder. (I usually release all my source changes, but I was lazy when I released my DOSBox mod.)"

Thank you very much for honoring my request, I (and hopefully others will) appreciate it! :)

(Hmph, what you call "lazy", I would prefer to just call too 'busy', what with so many other projects and all ... Besides, calling oneself "lazy" is really not appropriate, as it's normally someone else's opinion of us based upon their observation -- So, unless you happen to have multiple personalities, and BalleyVell or RalleyHell thinks you're 'lazy', you might want to reconsider calling yourself that. ;-) )

OK, I've just finished looking at the differences and I'm very impressed; It looks like most of those lingering issues should now be resolved, thanks to your patch. :-) There's just one thing I'm still uncertain about, though: DRO2MIDI doesn't handle songs in which use the Dual OPL2 mode; Am I correct to assume that (used along with your DOSBox mod and dro2vgm) vgm2mid won't have a problem with this particular mode?

ValleyBell wrote:
"That's because I do them both, permanently and temporarily. VGMPlay has native support for DRO files. (but it's DRO v1 "bug finder" is not as good as the one in dro2vgm)"

Hmmm, alright ... So, that sounds like it's probably best for us to just convert both our 'native' and 'modded' DROs into VGMs for their utmost compatibility with all of your tools.

ValleyBell wrote:
"That I don't comment on the jokes doesn't mean that I don't like them. (In fact I smiled quite a lot.)"

Okay, good, that's a bit of a relief. I'll have you know that, just like with other forms of art, it's purely inspiration. Well, then, my 'misunderstanding' here is most likely due to my coming across like a big ding-dong with all of this DRO-format stuff. ;-)

Wraithverge wrote:
"(Not going to happen ... ever.)" [i.e., about VGM perhaps one day supporting multiplexed channels]

ValleyBell wrote:
"Are you really [so] sure about that? :)
When I have quite too much time and feel like coding crazy things, I may add 4 channel panning options."

Well, first, to be honest, I originally wrote there something to the tune of '(I'd better shut up, because, with ValleyBell's skill, it just might happen!)'. But, when I considered what with these old audio devices, normally several input-channels get mixed together into just only one or two output-channels, it would be very difficult (if not impossible) for someone to generate more (i.e., additional) discrete output-channels than a device was originally designed to support.

Take, for example, what Malvineous and I did within in_adlib: He simulates stereo from a mono source by slightly pitch-shifting one channel opposed to the other, and I simulate stereo by using two different-sounding emulators, one on each channel. Each method has its pros-and-cons, but, they're the most that anyone could ever do with such a limited audio-output source.

Don't let me discourage you, though, because, if you can figure out how to somehow reroute, e.g., 8 input-channels into 4 output-channels instead of just 2, then that would be an incredible feat, indeed! ;) (Hmmm, simply "panning" two output-channels juxtaposed between a 4-channel matrix kind of reminds me of the old Quadraphonic system used back in the early 1970's -- I guess we might could call this something like a 'Pinwheel' or 'Windmill' effect'? -- Odd, but somewhat interesting ... )
  View user's profile Send private message
Reply to topic Goto page 1, 2  Next



Back to the top of this page

Back to SMS Power!