Re: [hatari-devel] Improved YM2149 cycle accuracy

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 26/07/2021 à 21:46, David Savinkoff a écrit :
On Sun, Jul 25, 2021 at 12:57 PM David Savinkoff wrote:

    Hi Nicolas,

    I looked at the code and found that some filter coefficients need to
    be converted to 250 KHz. The enclosed patch does the job.
    I made the patch without testing or compiling because it is
    simple and I'm not set up for Hatari at the moment.

    Once the patch is applied, only YM2149_Next_Resample_Nearest()
    is needed (the best choice). The IIR filters are as efficient as
    the YM2149_Next_Resample_Weighted_Average_N() method.

    Hatari should have the same good timbre as it did when the filters
    were implemented a few years ago

    David Savinkoff

    ps. If the sound is wrong, I'll have to double check the coefficients.

More comments and coefficients improved to 1% of target fc @ 250KHz

Hi

I tried your patch and the sound is slighly less "sharp", as if some high freqs were more filtered, but the difference is not huge (you can check in STF mode with syncsqu.snd I attached earlier)

Hard to tell which one is the closest to a real STF :)


As for YM2149_Next_Resample_Nearest(), I don't think it will give the best result, because it will downsample a 250 kHz input to 44.1 kHz for example, using only 1 input sample every 250/44.1=5.66 samples, thus not taking into account a big part of the input samples.

This might be OK when emulating YM2149 for sound having period>=6, but with very high freq sound, this gives bad results.

IIRC this was hearable in the game Lethal Xcess in STF mode where they play digi sound by setting period=0 on one voice and modulating volume for this voice. In that case YM2149_Next_Resample_Weighted_Average_N() gives much better result as it uses all samples from the 250kHz input signal.

Nicolas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/