VGM player from SMS on MD or GENESIS

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

Moderator: BigEvilCorporation

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

VGM player from SMS on MD or GENESIS

Post by tinctu »

Is there any Sega Master System *.VGM (Texas Instruments soundchip) music player for Sega MEGADRIVE???
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ »

Any VGM player for the Megadrive should be able to play files that only use the PSG, unless it's ignoring the PSG write commands.
TmEE co.(TM)
Very interested
Posts: 2452
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) »

There is a MD VGM player, but it doesn't work on real HW, and the author is too lazy to get it working :(
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ »

This seemed like a simple enough task, so I decided to write a player (you can get it here).

To create a Megadrive binary from a VGM file, use the following command in a windows commandline window: copy /B /Y vgmplay.bin + filename.vgm output.bin

This appends your (uncompressed) VGM to the player code and creates a binary that you can run on your Megadrive, or in an emulator. The zip includes an example (smurfs.bin) with one of my favorite SMS songs added.

Note that my player ignores all wait commands except 0x62/0x63, so songs that rely on shorter waits will probably sound weird. It still seems to work fairly well, and it runs on HW (at least on my european Megadrive). And the source code is included if you want to improve it in any way.
tinctu
Very interested
Posts: 97
Joined: Tue Oct 30, 2007 8:28 pm

Post by tinctu »

Thank You _mic I will test it...
Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser »

Thanks a lot mic_ :D
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_ »

Here's an updated version of the player. It now supports all wait commands, and uses the YM2612 for timing instead of vsync, so it should work better.
Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser »

Thanks again! :)


- Do you think it can be updated to play MD VGM files too ? Also, I would like to know if it supports GG stereo files ?
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image
TmEE co.(TM)
Very interested
Posts: 2452
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) »

GG stereo can't be done on MD's PSG, though if you use YM2612 to do the PSG, you can have that stereo.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru »

TmEE co.(TM) wrote:if you use YM2612 to do the PSG, you can have that stereo.
One small problem. You'll get stereo, but with completely different sound - YM2612 can't generate square tone and can't generate noise which will at least resemble noise of PSG. It's possible to get somewhat resembling 'Enhance PSG' feature of Dega, though.
TmEE co.(TM)
Very interested
Posts: 2452
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) »

Noise would stay as PSG... squares aren't difficult at all, only minor tonal difference.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

With four operators, square waves are easy. Set the first to the center freq, the next to the third harmonic, the next to the fifth harmonic, and the last to the seventh harmonic. That'll make a better square wave than the PSG can make. :lol:
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ »

Set the first to the center freq, the next to the third harmonic, the next to the fifth harmonic, and the last to the seventh harmonic.
You can only set the frequency per operator on channel 3, though.
Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis »

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.
TmEE co.(TM)
Very interested
Posts: 2452
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) »

That video Nemesis posted explains everything.

I have an istrument that uses 2 operators, and while what you see on the o-scope screen doesn't really look like square wave, it certainly sounds square. If anyone wants, I can give you the TFI of the instrument.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Post Reply