zeroone wrote:
Rainwarrior, I found it interesting that you combined the accumulators with the wave indices into a single phase variable to make the frequency addition overflow automatically update the indices. But, I decided to keep the variables separated for clarity.
I don't think of that as a trick or anything. I'm pretty sure most wavetable hardware does it this way internally. You have a digital phase accumulator, where some of its high bits address the wavetable, and the lower bits just act as a fixed point precision for the pitch. Why would you want to separate them? They're always updated together in one step.
zeroone wrote:
Also, on lines 345 and 347, val is AND'ed with 0x7F. It's unclear why 0x07 is not used.
On line 372, I think it should read adr <= 0x407F, not adr < 0x407F.
On line 63, you chose to use the continuous-time formula to compute the smoothing factor. The
discrete version produces a slightly different value. But, this is pretty irrelevant. In fact, I chose an arbitrary smoothing factor based on what I thought sounded right.
Those are both bugs. Thanks. I'll fix them. I probably didn't notice the mistake because there aren't any games that attempt to read back the wavetable, and I don't think anything writes the mod-table with out of bounds values either, but that could do some crummy things. :S
As for the RC filter implementation, I'll look into that. It's not important for emulation (the real FDS filter isn't a simple lowpass, this is just an approximation that is similar), but if the cutoff is inaccurate vs. the specified value it would be good to improve them. I think the calculations I used were taken from
an old DSP reference book that I like, but I don't mind taking another look at the theory.