Re: [hatari-devel] Improved YM2149 sound

```On 06/05/2012 21:41, David Savinkoff wrote:
```
```To correct misleading typo in my previous explanation.
See (Correction).
****

Quartet mode represents the output voltage stripped of high frequency
AC component, but DC component remains.
The Quartet math model is:

(MaxVol*WARP) / (2.0 + 1.0/( 1/Ra + 1/Rb  + 1/Rc))
or
(MaxVol*WARP) / (1.0 + 0.5/( 1/Ra + 1/Rb  + 1/Rc))    (Wrong)

(MaxVol*WARP*0.5) / (1.0 + 0.5/( 1/Ra + 1/Rb  + 1/Rc))  (Correction)

Note that the 1.0 represents the normalized 1k resistor. 0.5 represents
50% duty cycle for the parallel resistors being summed (this effectively
doubles the pull-up resistance).

David

```
```

Hello

sorry for late replay, had very few time lately.

```
Regarding the description of the math model in this mail and the previous one, could you add it to sound.c as a comment ? I think it would be great to keep those details in the sources too, not just in the mailing list.
```
```
Then, regarding the "-1" correction you do for Quartet mode, I think it should be inside a block with :
```
if ( reg7 & 0x3f == 0x38 )    /* all tones are ON, noises are OFF */
{
for each voice : do vol=vol-1 if per==0
}

or maybe better :
if ( ( reg7 & 0x3f == 0x38 ) && ( per==0 for all 3 voices ) )
{
for each voice : do vol=vol-1
}

```
If not, you could have a case when a "normal" (non sample) music is played on voiceA and voiceB and voiceC goes to per==0 at one point. In that case, I don't think we should emulate Quartet mode and do the DC correction ; Paulo's table are only valid when all 3 voices are ON with per=0 at the same time.
```
What do you think ?

In the meantime, I commit your patch, we can modify it later.

Nicolas

```

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