Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
vgmlib - SMS VGM player for BGM and SFX
#1
I have published library, driver and source files to github for the VGM player I put together to play SMS VGM files as BGM and SFX.  The library can integrate into projects using the existing C framework.

For me, this is a better sound/music solution than what has been previously publicly available.

https://github.com/winteriscomingpinball/vgmlib-ngpc

The repository contains the source for a simple example rom that shows how to setup and play the music.

The repository also contains a python script to convert SMS VGM output from Deflemask (or any SMS VGM file) to NGPC.  The files have to be tuned in order to sound correct on the NGPC because it runs at a different clock rate than the SMS.

Special thanks to sodthor, mic_, and Ivan Mackintosh, whose generous sharing of their source code and knowledge allowed me to get to where I am.

------------------------------
Update 5/16/2023 - I recommend using this one instead that supports tracks composed for the chip that is in the NGPC: https://forum.freeplaytech.com/showthread.php?tid=5423
Reply
#2
Is that repo marked as PRIVATE, because I can't get to that link.
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply
#3
(02-09-2022, 09:05 AM)Flavor Wrote: Is that repo marked as PRIVATE, because I can't get to that link.

Ah, that should be fixed now. Thanks!
Reply
#4
That's brilliant - I'll always admit that sound has been the worst implemented feature in my projects. Will give this a try later.
Reply
#5
Excellent work! This inprove the sound possibilities into ngp game dev. Thannks a lot!
Reply
#6
Just got this integrated into my latest project (only took me three years) and it's great, thanks for your hard work.

I'm struggling a bit with the workflow (I'm a bit clueless with the technical aspects of sound/music generation) - do you think you could publish the .fur files you used?
Reply
#7
(04-24-2025, 06:21 PM)Ahchay Wrote: Just got this integrated into my latest project (only took me three years) and it's great, thanks for your hard work.

I'm struggling a bit with the workflow (I'm a bit clueless with the technical aspects of sound/music generation) - do you think you could publish the .fur files you used?

I started in deflemask before I discovered furnace, so many of my files are dmf files composed for SMS. Note that furnance can open the dmf files. I uploaded the ones that I think are used in the repo:

https://github.com/winteriscomingpinball...ic%20files

Basically just get furnace making the sound/music you want and export it to vgm. Then the vgm file can be processed through the script in the repo.

Note that anything composed for SMS has to be tuned (via the script) in order to sound right on NGCP. Anything composed for t6w28 does not. I don't recall if I included the tuning script in the t6w28 repo or just my original SMS-based repo. Both repos are linked in the first post of this thread.
Reply
#8
Okay, thanks. I think I've got a workflow now - albeit that it's more error than trial

Works wonderfully - excellent job Smile
Reply
#9
I've roped a musician friend in to doing some tunes for me and I think I've found a bit of a bug - if I use VGM_PlayBGM_X_Times() then it seems to leave the player in an invalid state when it finishes - sometimes this will lead to the speaker just buzzing for a while - I think I've tracked it down to this snippet in VGM_SendData()

What I'm doing is, instead of playing a single tune in a loop, I play it once and then, when it's finished, starting a new one - sort of an adaptive music system. 
I've added a function to expose the play_bgm variable (VGM_Is_Music_Playing()) and then when the loop is finished, I send the next snippet


Code:
if(bgm_end_reached){
                        
                        vgm_readpos_start=bgm_loop_offset;
                        
                        vgm_readpos_end=vgm_readpos_start;
                        bgm_end_reached=0;
                        
                        if (bgm_limited_play){
                            if(bgm_play_count)  bgm_play_count--;
                            if (!bgm_play_count) play_bgm=0;
                        }


I've changed this in my working version as follows:

Code:
if(bgm_end_reached){
                        
                        vgm_readpos_start=bgm_loop_offset;
                        
                        vgm_readpos_end=vgm_readpos_start;
                        bgm_end_reached=0;
                        
                        if (bgm_limited_play){
                            if(bgm_play_count)  bgm_play_count--;
                            if (!bgm_play_count) VGM_StopBGM();
                        }

But I think it might be clipping the music off when I do that? Does this make sense?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)