Re: [hatari-devel] Hatari plays all voices in phase

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


Le 28/12/2015 15:56, Troed Sångberg a écrit :
I think you should only compare with target hardware, not SC68 :) I only
pointed out that I know Ben tries to emulate the in/out-phase thing,
which Hatari doesn't. In my tests the conclusion was:

1) Target hardware will "randomly" be in and out of phase when playing
the voices
2) SC68 will sometimes not be in phase
3) Hatari will always be in phase

For the, I think, separate issue with the hi-hats, SC68 is indeed closer
to the target volume of the hi-hats than Hatari. I've right now listened
through the recording by evil at
https://www.youtube.com/watch?v=sBufLphwVlg and compared to the original
sndh in VLC (with the sc68 plugin) and my own .wav recording from hardware.

7an, who is a musician, doesn't consider sc68 to be _correct_ either -
but I as a non-musician will say that at least the perceived volume of
the hi-hats seems close to my target recording :)


I have some ideas about the cause for the phase difference ; it's something that I tried to find documentation from yamaha but was never able to find.

Basically, it comes to :

- how does the ym2149 handle the "period" counter to do a square wave : does it increments a counter until it reaches "period" value and then toggles between 0 and 1 to give the square wave, or does it decrements the "period" counter until it reaches "0", then toggle between 0 and 1 (most old chips will often decrement and compare with 0 as it requires less logic gates)

- what happens when a new value is written in "period" ? Does it restart the current wave immediately ? Does it becomes the new value to reach in case we use an increment, or is it latched until the end of current phase ?

This could be measured with a logic analyser, but unfortunately I don't have one :(

I saw many projects emulating the ym2149 (soft or fpga) and claiming "perfect emulation", but in the end, no one has a clear answer to this, it's often based on how other YM chip worked, but experience proved that not all YM chips had the same inner work.

I will try to change the way Hatari latches/restarts the new value in "period" to use a different method, hopefully it will give a better sound and an empirical proof of the correct working.

Nicolas



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