For some time I've wanted to write a series of tools for Mega Drive audio creation/editing, ones that involve actual audio, over the years I've never had the time to actually sit down and do that as I am frequently busy with things. Recently I've taken the time to make a stab at something audio related, so the opportunity of time has flown my way. The YM2612 and the Mega Drive's audio has been well documented in various places, and I've known a great deal about the chip and how frequency modulation synthesis works for many years, so programming code to emulate one is a real cinch. There are some tidbits however which don't appear to be mentioned, or if they are mentioned, they're quite vague, hidden, or use somewhat complex terminology. So I've taken the time to make some hardware recordings from my model 1 Mega Drive, and make some visual observations on the resulting waves, and I had found some answers for many of these minor tidbits. Natsumi suggested I should share this, I was in two minds about it, because it's always my luck that I share a bit of information and it then turns out it's already documented somewhere and just isn't quite visible. I figured though I could just share my observations as a type of... shall we say, "diary", or "blog" if you will, all shared under the assumption that many of you might already know the information, or the information is already available in some form, these are just my findings, and nothing more. It's not meant for bragging or public discovery, it is simply here for those that might be interested. So far I've observed the following... Sinewaves generated by the operators are always reset when the operator is key'd on, though not when key'd off. This might be obvious, but it does explain why keying on an instrument that has a gradual release rate tends "pop" the audio: As you can see in the same image above, sinewaves start initially going downwards, I was quite surprised by this one, I was expecting the sinewave to go upwards first, not that this makes much of a major audio difference mind, but there is a slight difference when an operator modulates a sinewave, it can produce slightly different audio. I was debating on whether or not my computer's sound card has the polarities in reverse, or perhaps the polarities are shoved out in reverse from the console's jack itself. A modulator operator's sinewave will push the frequency upwards first, then down. This too was surprising in that the sinewaves goes down into negative first, I would've expected the frequency to drop downwards, and the carrier's frequency to go in reverse. But the opposite happens: Not a major thing, but it was something I wanted to be 100% sure on, I expected this to be the case and it was. The amplitude of the carriers are capped to the maximum audio range of the channel, but the amplitude of the modulators are not capped when they are modulating the frequency of a carrier. Four operators as carriers: Two operators individually modulating a carrier at the same time: I was surprised to find that even if a speaker is disabled via panning, that the sinewave's position still affects the filter/DC correction mechanism. The audio was panned to one speaker, and the other speaker still had an affect: The amplitude of the YM2612 is logarithmic (or exponential depending on which way you view it), which is a known fact of course, but I was surprised to find the attack rate didn't flow in the same manner: What's more interesting about this attack rate, is that on closer inspection, unlike the decay rates, this isn't smooth and is actually a series of steps: Very jarring steps too, and at equal times too, I therefore suspected the chip had some sort of prefixed procedure in place for producing it, I wasn't sure if this was intentional, I suspect so and perhaps it's to prevent a too sudden pop from attack to decay, but that sounds somewhat silly to me. While I'm not entire sure what calculation is going on here, I have had some pretty accurate success with this by taking the distance the amplitude has to reach to get to maximum, and adding a fraction of that to the amplitude every width of each step: Not 100% but it is close, so I suspect either this is what's going on, or there's a reversed logarithmic amplitude mechanism involved which is enough to counter the logarithm of the volume near it's extreme curve. But again, no idea. Decay and Sustain rates yield identical fade outs: Release rate is the same calculation, except only the odd slots you see above. These are linear fade outs, but of course the logarithmic volume causes the curves, each step is a step up in "to the power of" from what I've been picking up while trying to emulate it. Here is a volume comparison between FM, PSG tone/noise and DAC random output: Unfortunately the filters are interfering with the tests, even if the frequencies/tones are matched between say an operator's sinewave and a tone channel's squarewave, the filter will still portray their actual amplitudes incorrectly, as an example, here is the entire frequency range of the YM2612: I apologies it's a screenshot from a fair far distance, but a close up would resemble an image perhaps too large to store, sorry about that. Recording every frequency from 0000 to 3FFF (every octave/frequency) with an operator set to MUL of 1 (which should be x1 the frequency), every frequency was played for a single second, with the attack/release rates at really high keying off and rekeying on for every frequency, this took around nearly 5 hours to record... But you get the idea, because of the filter, obtaining the actual amplitude is quite tricky, but it does show the low-pass cut-off point to some degree. I'm still doing some observational recordings as and when I need the information, so if you are interested in what's here so far, then I'll be happy to share more info and shots as and when I collect them. Much of the FM stuff I need I've almost got, but I have yet to look at PSG more closely, what I would like to do is obtain the PSG white noise pattern, I think I might be able to obtain it with some high degree of accuracy if the frequency is low enough but the volume is high, might be able to write a program to average out the wave and find the exact steps involved, but we'll see.