Re: [hatari-devel] Improved YM2149 sound |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
On 05/05/2012 22:13, David Savinkoff wrote:
Hi, This patch is for more accurate YM2149 sound. Sounds better also. Tested ok, specifically on: Decade demo (quartet screen), Madness demo, Blubber demo, sh11inv demo. Hunk 1) Fixes a typo of mine. Hunk 2) Improved YM2149 math model. Hunk 3) " Hunk 4) " Hunk 5) " Hunk 6) Discard frequencies higher than 80% of nyquist rate. Hunk 7) " Hunk 8) DC level correction for high frequencies 'quartet mode' Hunk 9) " David
Tone3Voices&= ( Env3Voices | Vol3Voices ); /* D/A conversion of the 3 volumes into a sample using a precomputed conversion table */ + + if (stepA == 0&& (Tone3Voices& YM_MASK_A)> 1) + Tone3Voices -= 1; /* DC level correction for high frequency 'quartet mode' */ + + if (stepB == 0&& (Tone3Voices& YM_MASK_B)> 1<<5) + Tone3Voices -= 1<<5; + + if (stepC == 0&& (Tone3Voices& YM_MASK_C)> 1<<10) + Tone3Voices -= 1<<10; + sample = ymout5[ Tone3Voices ]; /* 16 bits signed value */
Helloregarding hunk 8, this means that when StepA == 0, then a volume of 0x14 for example will become 0x13. What is the math reason leading to decrement the voice volume by '1' for quartet mode ?
Nicolas
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |