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 - Hardware VGM Player using SN76489 chip

Reply to topic
Author Message
  • Joined: 04 Dec 2008
  • Posts: 5
Reply with quote
Hardware VGM Player using SN76489 chip
Post Posted: Mon Dec 22, 2008 6:17 am
I've been working on a hardware VGM player that uses a SN76489 chip. It was put together using an arduino microcontroller (an open source electronics prototyping platform).

Video of Circuit Playing Zan Gear Tears of Mortification. The VGM file is being read from a 256K EEPROM and sent directly to the SN76489 PSG Sound Chip:
http://www.youtube.com/watch?v=8lQ7ueie1UM

Picture of Circuit:
http://flickr.com/photos/luis2048/3046824621/

Schematic:
http://flickr.com/photos/luis2048/3075133313/in/photostream/

More Documentation of the project can be found here:
http://blog.luis.net/search/label/vgm

It is using a 4Mhz oscillator until I can get the programmable oscillator using the real frequencies (PSG = 3579545). It also has some YM2612 goodness, but I thought this forum would be interested in the PSG portion.
  View user's profile Send private message Visit poster's website
mic
  • Guest
Reply with quote
Post Posted: Mon Dec 22, 2008 7:49 am
Very cool. Reminds me of Kevtris' old projects.

Now fit it inside an SMS joypad with an 8x1 LCD on top ;)
 
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Mon Dec 22, 2008 9:17 am
Does it not bother you to have the wrong PSG noise implementation? I wonder how much work it'd be to get a Master System (or even Mega Drive) VDP running in a PSG-only mode?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8652
  • Location: Paris, France
Reply with quote
Post Posted: Mon Dec 22, 2008 10:07 am
Awesome little thing. Not really practical but the geek-o-meter is high.
Now to make it smaller :)
  View user's profile Send private message Visit poster's website
Charles
  • Guest
Reply with quote
Post Posted: Mon Dec 22, 2008 6:21 pm
luis2048 wrote
I've been working on a hardware VGM player that uses a SN76489 chip. It was put together using an arduino microcontroller (an open source electronics prototyping platform).


This is fantastic. I cannot tell you how impressed I am to see a stand-alone VGM player, with FM support no less. Amazing!

I am curious, isn't some kind of amplification circuit needed for the audio output? It looks like the SN76489 / YM2612 lines are more or less directly connected to the audio connector. Does that work, or is there an external amplifier it would connect to?
 
  • Joined: 31 Oct 2007
  • Posts: 853
  • Location: Estonia, Rapla city
Reply with quote
Post Posted: Mon Dec 22, 2008 7:23 pm
YM2612 should have some really low output levels compared to PSG... at least MD VDP PSG... I need to amp up YM2612 and attenuate PSG quite a bit to get decent volume level.
  View user's profile Send private message Visit poster's website
  • Joined: 10 Oct 1999
  • Posts: 211
  • Location: Lebanon, New Hampshire, USA
Reply with quote
Post Posted: Tue Dec 23, 2008 5:47 pm
I agree that an SMS VDP would be better than the SN76489, but a Game Gear ASIC would be even better - stereo! Do we even know the relevant pinouts for any version of those ASICs yet?

Anyway, very nice work!! This saves me the trouble of learning how to put a hardware VGM player together myself.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Dec 2008
  • Posts: 5
Reply with quote
Post Posted: Sun Feb 22, 2009 8:29 am
Getting PSG sound out of the VDP chip is quite scary. It's a surface mount monster with way too many tiny pins. I personally cant tell the difference between the different noise implementations.

Here's a video of my circuit playing RushJet1's 2007 music competition entry. I'm having a little difficulty getting the timing perfect. It slows down a lot when there are a lot of arps. Its running on a 3.57Mhz oscillator this time.
http://vimeo.com/3293456

I am using the following formula to get timing delay values
1000 / (44100 / samples) = number of milliseconds to wait

VGM file data
===============
62 Wait: 735 samples (1/60s)
1000 / (44100/735) = wait 16.666 Milliseconds or 60th of a second

61 5b 0e 3675 samples (83.33ms)
5b + 0e = 0xE5B = 3675 samples (little-endian byte rearrange)
1000 / (44100/3675) = wait 83.33 milliseconds

Does that look right?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Sun Feb 22, 2009 9:22 am
The timings look right, but is the processing zero-time? Arpeggios mean a lot more data to process. If you aren't using an external timer base then the processing time will add onto the delay times.

The noise implementation does sound a lot different - the SMS one is more percussive, the SN76489 one is more hissy. The biggest difference is "periodic noise" - on the wrong chip it becomes out of tune.
  View user's profile Send private message Visit poster's website
  • Joined: 04 Dec 2008
  • Posts: 5
Reply with quote
Post Posted: Fri Nov 20, 2009 7:57 am
Thanks for the insight. I compensated for the time it takes to read VGM data from eeprom. It sounds much better now.

http://www.youtube.com/watch?v=RGmcpfYpsD8
  View user's profile Send private message Visit poster's website
  • Joined: 12 Apr 2005
  • Posts: 391
  • Location: London, United Kingdom
Reply with quote
Post Posted: Fri Nov 20, 2009 11:19 am
Very good! I wonder if you could correct the periodic noise's period in software to compensate for the 15/16 bit mismatch?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Fri Nov 20, 2009 12:57 pm
Should be possible. I did some preliminary work on that - to convert a BBC Micro VGM to SMS - but then abandoned the idea for yet another ripped music engine :)
  View user's profile Send private message Visit poster's website
  • Joined: 10 Oct 1999
  • Posts: 211
  • Location: Lebanon, New Hampshire, USA
Reply with quote
Post Posted: Fri Nov 20, 2009 4:13 pm
Luis, when are you going to post some schematics & the ROM image so I can finally throw my iPod into the river?
  View user's profile Send private message Visit poster's website
  • Joined: 04 Dec 2008
  • Posts: 5
Reply with quote
Post Posted: Mon Jul 26, 2010 5:34 am
You can have the source code for the VGM player:
http://luis.net/projects/duinodemo/demo_platform.zip

the final product was turned into this:
http://www.youtube.com/watch?v=OD9BiYzNAIg


VGM Music Files used:
http://luis.net/projects/duinodemo/music/Ghost%20Ship.vgm (FM)
http://luis.net/projects/duinodemo/music/Missing.vgm (PSG)
http://luis.net/projects/duinodemo/music/Power%20Plant.vgm (FM)

from this musician
http://www.myspace.com/bluereverberance

Browse the project online (includes music sources too):
http://luis.net/projects/duinodemo/
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!