VGM player from SMS on MD or GENESIS

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Aug 20, 2008 9:42 pm

Nemesis wrote:You can only set independent frequencies for channel 3, but every operator in every channel has a "multiple" register, which allows you to set that operator to a harmonic ratio of the common frequency for that channel. The available settings are 1/2, and 1-15. So, even though the common frequency might be 440, you could set operator 1 to 1*freq, operator 2 to 3*freq, operator 3 to 5*freq, and operator 4 to 7*freq using the separate mul register setting for each operator.

The completely separate frequency registers for each operator which you can set for channel 3 allow you to set frequencies for each operator that are inharmonic, which is actually not that common a thing to require. The separate detune register for each operator can be used to achieve slight inharmonic adjustments for each operator, so the completely separate frequency registers are only needed for more severe detuning, or dissonant sounds.

Here's a really good video that explains what that all means:
http://insidesynthesis.blogspot.com/200 ... chive.html
I don't think I really "got" FM synthesis until I watched this video.
What he said. :D I should have been a bit more explicit since some folks aren't completely familiar with these old FM chips. Sorry about that. :oops:

Oh, be sure to use the algorithm that just adds all the ops together when making a square wave.

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Thu Aug 21, 2008 7:04 pm

Here's a new version that plays VGMs that use the PSG and/or the YM2612.
DAC timing is still a bit off, so songs that use the DAC may play a bit too fast or too slow, but overall it works quite well both on HW and in emulators.

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Thu Aug 21, 2008 9:35 pm

mic_ wrote:Here's a new version that plays VGMs that use the PSG and/or the YM2612.
DAC timing is still a bit off, so songs that use the DAC may play a bit too fast or too slow, but overall it works quite well both on HW and in emulators.
Sweet! I can't wait to test it :D
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

tinctu
Very interested
Posts: 97
Joined: Tue Oct 30, 2007 8:28 pm

Post by tinctu » Mon Aug 25, 2008 3:00 pm

I will test it...
I dont need have GG stereo tunes...
I want make tunes in MOD2PSG2 and play them on MD...
Or another tunes from SMS games...

Thank You _mic !!!!!!!!!!!!!!!

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Aug 17, 2009 11:22 am

Here's the latest version of my player

It includes the VGM packer I've been talking about in another thread, a ROM builder and a player binary (plus the source code for all these things).

Just fire up the ROM builder, drag & drop the VGM files to the listbox (VGZ isn't supported by the ROM builder atm) and press Build. You should get a file called VGM_PLAY.BIN that you can run on your genny or in an emulator.

There are still some quirks.. like that the ROM builder and packer don't accept file names with spaces in them, the playback code doesn't clear all sound registers when you switch to another song, and PCM timing is still a bit off for some songs.

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Mon Aug 17, 2009 12:37 pm

That's great! Will try as soon as time permits! :D

- Hope you can fix the PCM timing issues soon.
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Aug 17, 2009 2:02 pm

The inaccuracies seem to occur when a lot of short delays are used, like one sample or two samples each. In those situations the playback rate becomes slower than what it should be.

One example of such a song is the last song from Gods ("Complete tune").

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Aug 17, 2009 7:30 pm

A few improvements

The packer can now read VGZ files, so there's no need to unzip them first. And file names can now contain spaces.

tinctu
Very interested
Posts: 97
Joined: Tue Oct 30, 2007 8:28 pm

Post by tinctu » Tue Aug 18, 2009 11:19 am

Thank you _mic this player is very useful for me.
One more thank you!!!

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Tue Aug 18, 2009 7:53 pm

Looping would be totally messed up for some songs because 1) the packer would generate loop offsets that were slightly off, and 2) the player only used the lower 16 bits of the offset. I've fixed it now.

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Wed Aug 19, 2009 1:35 pm

Woot! :D


- Can you fix the PCM inaccuracies with the help of MIKE-STAMP's VGM Player ? The source code is available here.
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

Post Reply