SN76489 noise channel issue : sounds totally wrong

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

Moderator: BigEvilCorporation

Post Reply
sigMate
Interested
Posts: 21
Joined: Sun Mar 25, 2012 2:28 pm
Location: Paris, France
Contact:

SN76489 noise channel issue : sounds totally wrong

Post by sigMate » Fri May 04, 2012 11:02 pm

Hello,

I received SN76489 chips so I updated my hardware VGM player with one of them and I almost had the pleasure to get it working on my first try (everything was ready from the code to the electronics) but I now have a very strange issue with the noise channel.

Before going any further, I've to say that I know very well I won't get a sound close to the MD/SMS because of the different shift register implementation. But all the documentation I read about this says that it ends up with a "slight" difference in the result from the noise channel.

My problem here is that all the three tone channels are working perfectly, but the noise channel is not. To be very precise, it sounds like a very low pitched rumble almost all the time (where it should be like a high "hiss" sound for hihats and so on).

My question is : is this the real difference between the VDP and a SN76489 (meaning, it _really_ doesn't sound the same at all) ?! Or am I just having a little issue I should be able to fix ?

Here are records I've made (using a song from Street of Rage) to explain a little more :

Audio files #1 and #2 come from a software VGM player I made (which features Maxim's PSG noise implementation BTW :)), #1 has all channels (YM2612 + PSG), #2 has just PSG.

Audio files #3 and #4 come from my hardware VGM player. You'll notice the global pitch is a little higher. That's because I'm waiting for a second adjustable clock generator (the YM actually has one but I tuned it up a little so it fits more nicely with the SN76489 which runs at 3.68 MHz instead of 3.57 MHz). #3 has all channels (YM2612 + SN76489), #4 has just SN76489. At the end of file #4, I stopped the VGM stream so the chip is "frozen" in its state so you can hear the really wrong noise it makes.

For a quick comparison, just listen to audiofiles #2 and #4 and you'll hear the three tone channels working but not the noise channel.

Audiofile #1
Audiofile #2
Audiofile #3
Audiofile #4

Hope someone will have any clue !

Thanks for reading.

Cheers,

sig

sigMate
Interested
Posts: 21
Joined: Sun Mar 25, 2012 2:28 pm
Location: Paris, France
Contact:

Post by sigMate » Sat May 05, 2012 7:02 pm

Well, it turned out I solved it by myself but I'd like to share this with you guys since I think it's revealing something I just couldn't find ANY documenation about.

As you probably know, most noise sounds are produced by configuring the noise channel to use tone channel 3 output as a shift rate and with a "white noise" mode. The corresponding data byte to do this is 1 110 0111. Of course, it is also needed to set the frequency of the tone channel 3, which is generally achieved like this (in most of the VGM files I've got) : 1 100 0000 and then 0 000 0000. This is where my problem was : curiously, on a real SN76489, setting any tone channel's frequency to 0 gives the lowest pitched note. Whereas I read that on Maxim's great documentation : "If the register value is zero or one then the output is a constant value of +1. This is often used for sample playback on the SN76489."

This is clearly not the case for me and it's the cause of my noise channel problem. If I adjust tone channel 3's frequency to 1 (highest note), then the noise is working perfectly.

I made a very simple MIDI implementation of the SN76489 to figure this out.

So I hope I'm not misunderstading something. Do you think this could be a notable difference between real SN76489s and VDP clones ?

Cheers,

sig

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Sun May 06, 2012 9:01 am

Maxim's documentation is actually wrong on this point, and all current emulators seem to use this wrong information. On the Mega Drive hardware, setting the tone data to 0 produces the same result as setting the tone data to 1, namely, the square wave inverts on each internal clock cycle. One game which I've noticed is affected by this is "After Burner II". You're saying that you found setting the tone register data to do something different again though. In your case, you get the opposite behaviour, where a setting of 0 gives you the lowest frequency note.

It seems that the behaviour with a tone value of 0 must be implementation defined. There may well be systems where the behaviour Maxim observed is correct. The integrated PSG in the 315-5313 chip works as I have described, while the discrete SN76489 you received gives the behaviour you have described.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Sun May 06, 2012 11:30 am

I also treat a value of zero exactly like a value of 1.
In Maxim's or MAME PSG cores, there was initially a "cut-off" value below which tone channels do not switch anymore. I think this is a quick implementation of low-pass filtering that exists at the output of the chip and I believe this is the reason that some hardware implementations does not sound the same as integrated PSG in Mega Drive, because such high frequencies are obviously going to be filtered by analog circuitry.

Post Reply