Jump to content
Tursi

VGM Compression Tool

Recommended Posts

Hey! Resurrecting this old post to note that the work I've been doing on version 2 of this tool is finally running on ColecoVision (well, hopefully, my hardware is packed so I can't test there at the moment!)

 

The goals of v2 were better CPU usage, less RAM usage, and better packing. CPU didn't go down much, unfortunately, but it did save a bit of RAM and pack a bit better on pretty much all songs. But there was a second goal - and that was a more complete toolchain for conversion.

 

I've got a whole thread over in the TI side and I'm going to continue to use that for updates, but as of tonight I've got the ColecoVision SN player, the AY player for SGM and Phoenix, and the Sound Effects player working. New posts start here:

https://atariage.com/forums/topic/225463-vgm-compression-tool/?do=findComment&comment=4493240

 

Unfortunately, I don't know Z80 well enough to do a deep hand-optimization of these like I did for the TI... but I may have to take a stab at it eventually anyway. I think if I do a first pass there should arise people to tell me how wrongly I did it. :lol:

 

I have some samples you can drop in a folder and play with:

- playerSN is a sample playing on the stock ColecoVision SN sound chip. It plays a conversion of the Journey to Silius title from NES (some of it anyway ;) )

- playerAY is a sample playing on the SGM or Phoenix AY sound chip. It plays a conversion of the Master System Afterburner (yes, an SN chiptune. Ironic ;) )

- playerSNAY plays a sample from Wonderboy in Monster Land arcade - originally a dual SN arrangement. It plays here on the AY and SN chips.

- playerSNSFX is just a port of the old demo app from my first version of this tool to show sound effects working

 

And if you just want something to watch, Piano is a quick port of the same demo I released on the TI last week, a conversion of the Protracker MOD GalaxyII using the new MOD conversion toolchain. I love it when a port just works. ;)

 

piano1.thumb.png.27d22cb9b93f492f871a143fa468164d.png

 

The code is all Windows, cause that's what I use, but it's all command line and should compile with minimal pain on Linux, although I didn't go out of my way to create makefiles (most tools are single source file and only the players use any Windows specific code). Source repo is up but it's not done yet - you can just grab the raw tools or docs in the "dist" subfolder.

https://github.com/tursilion/vgmcomp2

 

Anyway, just wanted to let you know that the Coleco side is functional at last... though it could use some optimization!

 

playerSN.zip playerAY.zip playerSNAY.zip playerSNSFX.zip Piano.zip

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

The samples sound fantastic. I manually had to figure out the ay playback recently which i succeed at but I really appreciate a tool set like this which will make that unnecessary in the future as i 'll use this library for sure. 

 

Thanks for converting this. i'm sure many people will use it.

Edited by digress
  • Like 2

Share this post


Link to post
Share on other sites

Maybe hand-optimizing is out, but I can /read/ Z80 code, and spent a few hours (more than I should have) tonight on optimizing the C code to get better output. The results are about 20% better, and I've pushed that up. There's still performance to be found, but this should be optimal enough to start using it. :)

 

Share this post


Link to post
Share on other sites
On 7/26/2020 at 10:11 PM, Tursi said:

Maybe hand-optimizing is out, but I can /read/ Z80 code, and spent a few hours (more than I should have) tonight on optimizing the C code to get better output. The results are about 20% better, and I've pushed that up. There's still performance to be found, but this should be optimal enough to start using it. :)

 

I think extending the last chapter of my book is in order with this update - very well done.  If you don't mind I will add VGM playback as a 2nd sub-chapter after my coverage of using the OS 7 BIOS routines.  And if I get time I will see if I can optimize the player code and share back here.

Can't wait to play with this some more!

Share this post


Link to post
Share on other sites
3 hours ago, Tony Cruise said:

I think extending the last chapter of my book is in order with this update - very well done.  If you don't mind I will add VGM playback as a 2nd sub-chapter after my coverage of using the OS 7 BIOS routines.  And if I get time I will see if I can optimize the player code and share back here.

Can't wait to play with this some more!

Sure, let me know if you have any questions. If it's useful to anyone, that's the point.

 

I was thinking it might be more efficient with a change of the data structure from an array of structs to independent arrays, just from looking at the generated code, but that pass will have to come later.

 

Share this post


Link to post
Share on other sites
Posted (edited)

Really nice work Tursi, but one thing I do not understand is how to make sfx in vgm format ?

I can understand how to convert mod to vgm, but what about sfx ?

 

Another point: I can't see source code of the vgm lib, we need to link with your .a file ?

*EDIT* found it in \Players\libcolecovgm2, sorry to have not checked before 

Edited by alekmaul

Share this post


Link to post
Share on other sites

That's cool, there are a lot of files in there...

 

Sound Effects are just really short audio clips, so you can make them with a tracker that outputs VGM, or by hand, or from a perl script of your own devising, or from the other sources the toolchain supports. The goal of the intermediate files being plain ASCII text was to make it easy to create input files for the compressor.

 

There is a separate player dedicated to SFX, for cases when you want music AND SFX this is necessary for two reasons. First, each must maintain their state (unless you pause the music, but I really wanted the music to keep going in the background), and second so the SFX can keep the music off channels it is using. Of course if you are not playing music but ONLY sound effects, then just use the regular player.

 

Share this post


Link to post
Share on other sites

Thanks for your reply.

The music driver works fine with my game Sir Ababol, the music renders really different from the mod file I used, but it is normal as the Coleco does not support samples. By the way, the result is great.

Regarding sfx, I will use the regular player but I wanted to know how to handle them with VGM. Now, it's ok, thanks to you ;)

For your information, I compiled the lib with sdcc 3.9 and it works fine.

Thanks again for your great work @Tursi !

Share this post


Link to post
Share on other sites

That's good to know, and I'm glad the MOD converted well for you! It's nice to be able to expand the MOD conversion after so many years.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...