New Documentation: An authoritative reference on the YM2612

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

Moderator: BigEvilCorporation

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

Post by Nemesis »

Well, as I mentioned before, I read somewhere (fucking wish I could remember where) that it's only 9 bit. That would seem to make more sense now, wouldn't it? No point in putting anything better in there if it's not going to get used.
Anything's possible. I must admit, I thought the YM2612 wasn't doing too much differently in terms of the DAC, despite the fact this one is embedded. Guess I was wrong. Different precision on the input is certainly possible. The circuitry of the DAC itself could also be very different, and there could well be errors in it as you suspect, or they might have taken some shortcuts to reduce complexity or power requirements. It's a fair bet this DAC was built, or at the very least customized, for the YM2612.
That channel order is fucking strange, though.
Yeah, I don't get that either.
Snake
Very interested
Posts: 206
Joined: Sat Sep 13, 2008 1:01 am

Post by Snake »

It might be interesting to try this on an MD2 and see if theres any differences. Not that it probably makes much difference in emulation, but still...
Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis »

I haven't modded a MD2 to sample direct from the YM2612 output. Let me grab one off the stack and see what I can rig up.
Snake
Very interested
Posts: 206
Joined: Sat Sep 13, 2008 1:01 am

Post by Snake »

Oh, and incase it's of interest - the YM2413 is the chip that has no accumulator... and also an embedded 9 bit DAC. Isn't that interesting.
Nemesis wrote:Let me grab one off the stack
Heh, how many have you got?
Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis »

Snake wrote:Oh, and incase it's of interest - the YM2413 is the chip that has no accumulator... and also an embedded 9 bit DAC. Isn't that interesting.
Hmm, maybe I can get my hands on one a run some tests on that. Comparing the two might help answer some questions. Hell, maybe I can put one in the Mega Drive in place of the YM2612.

Snake wrote:
Nemesis wrote:Let me grab one off the stack
Heh, how many have you got?
I honestly don't know. It seems like every time I move something or look in a box I haven't opened in awhile, I find another one hiding. O_o I bought too much Mega Drive stuff on ebay.
Snake
Very interested
Posts: 206
Joined: Sat Sep 13, 2008 1:01 am

Post by Snake »

Nemesis wrote:Hmm, maybe I can get my hands on one a run some tests on that. Comparing the two might help answer some questions. Hell, maybe I can put one in the Mega Drive in place of the YM2612.
Doubtful, the chip is very different. But it's the chip used in the Japanese SMS. Go on, now tell me you've already got one ;)

Just done some googling and found:
- OPLL: Budget version of the OPL2. It's quite cut down, and can only have 1 fm patch at the same time - the other sounds must come from a ROM that has 15 different FM sounds. Also lacks an accumulator (channels are summed together with an analog filter instead).
from http://www.soundshock.se/phpBB2/viewtop ... f8d5c#2280

OPLL=YM2413.
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) »

YM2413 will not start working in place of YM2612 unless you make code exactly for the YM2413... the pinout is very different aswell.

I'm looking forward to seeing some more info about MD2 sound :)

And by judging from aliasing noise, things do sound like the DAC is 9 or 10 bits...
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
Snake
Very interested
Posts: 206
Joined: Sat Sep 13, 2008 1:01 am

Post by Snake »

While we're waiting for Nemesis to do the tests, thought I'd post my thoughts on the distortion.

If you've ever looked at the waves produced, it seems as though one side performs exactly as it should, and hits silence when it should. But the other side doesn't, producing a non-sinewave. it takes much longer to get to zero, and it distorts on the way there.

It's been a long time since I've done any tests on this at all (5 years probably), but I've been thinking about it a fair bit recently. I *think* it's the negative side that has the problem (I'm sure somebody here can confirm), and if so, it would seem to indicate the chip handles negative samples incorrectly, OR that the values are scaled before hitting the DAC, and there is a problem with scaling negative values.

The standard yamaha DACs, as far as I remember, don't use 2s compliment, but I'm pretty sure the operators do, so theres another possible conversion that could go wrong.

It's also possible it's just a problem with the DAC itself, but that doesn't seem as likely, because the error is actually quite a large one.

With a decent scope and a bit of time, it should be possible to figure out exactly what's going on here. I have neither anymore, nor the capacity to run test code anymore, or I'd have done it already ;)
HardWareMan
Very interested
Posts: 753
Joined: Sat Dec 15, 2007 7:49 am

Post by HardWareMan »

Snake, you talking about "ladder" effect? Wich present in every channel separatly.
Snake
Very interested
Posts: 206
Joined: Sat Sep 13, 2008 1:01 am

Post by Snake »

Yes, indeed, the effect you refer to as the "ladder effect". It's more than that, though, if you look at samples.
Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis »

Ok, now that the final between Federer and Nadal is over (dammit!), here's some readings from an MD2, board PC BD MD2 VA1.8 PAL, with an embedded YM2612 in the 315-5660:
Image
Image
Very different to the MD1 with the "real" YM2612. The output is still multiplexed, and the strange channel order from the output is the same, but that's about it. Clearly this is a totally different DAC.
HardWareMan
Very interested
Posts: 753
Joined: Sat Dec 15, 2007 7:49 am

Post by HardWareMan »

Whoa... For complete picture, you should post recording from YM2612 clones: TA-07 and PCS-95.

Mmm... Square waveform consist from many harmonic frequences. To infinite high frequences. So, result output can be more complex, specially at high frequences. But saw waveform consist much less of high frequences, than square frequences. So, result output can be much clearer from harmonic frequences.
AamirM
Very interested
Posts: 472
Joined: Mon Feb 18, 2008 8:23 am
Contact:

Post by AamirM »

Nemesis wrote:
AamirM wrote:Spiderman Separation Anxiety. There is a problem in the intro, on channel 3 and 6.
Ahh yes, I think I know the instruments you're talking about. I looked into that a bit. Little known fact: Even when the LFO is disabled, amplitude (and frequency?) modulation are still applied, but the LFO waveform itself is locked. In the problem track on Spiderman, the instruments on channels 3 and 6 have AM sensitivity set to max, with amplitude modulation enabled on all operators. Whatever value the LFO is frozen at, it applies a large amount of attenuation to the instrument, making it much softer. Phase modulation may also be affecting the pitch. I haven't done full tests on this behaviour, as I haven't started work on the LFO yet.
Yeah, that seems to be it. Shame on me for not noticing it myself. :oops:

Btw, I would like to thank you again for all your work. :wink:
Snake
Very interested
Posts: 206
Joined: Sat Sep 13, 2008 1:01 am

Post by Snake »

I had a feeling this would look very different. From the pics it seems the MD2 DAC takes a lot longer to do the conversion, but isn't serial, which allows it the time it needs.

The original YM2612 probably uses the exact same DAC as the YM2413. Thinking about this some more, the much simpler straight 9 bit DAC and no accumulator will be much cheaper, because you can get away with a mono DAC. The left/right output will always be identical, so you can simply route the mono output to left/right or both.
Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru »

One interesting thing about YM2413: it has not single mono output, but two separate outputs for melodic and drum channels.
Post Reply