MFP / CPU clock ratio

A forum about the Hatari ST/STE emulator - the current version is v2.0.0

Moderators: simonsunnyboy, thothy, Moderator Team

User avatar
npomarede
Atari God
Atari God
Posts: 1160
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: MFP / CPU clock ratio

Postby npomarede » Thu Jun 29, 2017 4:51 pm

Steven Seagal wrote:For hi-hats in Hatari, we know it wasn't really the filter but noise frequency.
Nope :) Noise frequency is correct in Hatari 2.0 and in all Hatari version since many years, it was just when rewriting the new cycle exact YM in the devel version that I forgot to take it into account.
But even so, Troed confirmed me that hi-hats sounds from 7an were still not correct, which is due to too much filtering.
The filter is very subjective because it depends on the TV/monitor/connection. There is not only one good filter.
I recently could hear the output of my STE on PC speakers through the phono connection: yuck! To be accurate we should emulate all parasites due to bus activity, pixel colour etc.

On my STF connected to a rather good HIFI system I never heard such parasites. Maybe it's STE only (worse isolation ?), or maybe it's your cable ?
Only case when I hear some kind of parasite is if the YM doesn't play any sound and I turn the volume to the max on my old CRT monitor. Then the CRT's speaker can output a small noise that depends on what's on screen, but I think it's more a problem in the SCART cable (not enough isolation between each individual cable, so video RGB signals alter audio signal) than in the ST's output itself.
To record my STF output, I soldered more than 25 years ago a kind of do it yourself "stereo" board ; it's soldered directly on the pins of the 3 voices of the YM and there's really no noticeable parasites.

Nicolas

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1950
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: MFP / CPU clock ratio

Postby Steven Seagal » Thu Jun 29, 2017 5:25 pm

npomarede wrote: Nope :) Noise frequency is correct in Hatari 2.0 and in all Hatari version since many years, it was just when rewriting the new cycle exact YM in the devel version that I forgot to take it into account.
But even so, Troed confirmed me that hi-hats sounds from 7an were still not correct, which is due to too much filtering.


Right, I didn't know there were 2 different problems. Of course, there would have been complaints before...
But then it depends on what we listen to the tunes.
One thing I thought: If we use Paulo's table, isn't STF filtering already factored in? Maybe you're applying double filtering?

On my STF connected to a rather good HIFI system I never heard such parasites. Maybe it's STE only (worse isolation ?), or maybe it's your cable ?
Only case when I hear some kind of parasite is if the YM doesn't play any sound and I turn the volume to the max on my old CRT monitor. Then the CRT's speaker can output a small noise that depends on what's on screen, but I think it's more a problem in the SCART cable (not enough isolation between each individual cable, so video RGB signals alter audio signal) than in the ST's output itself.
To record my STF output, I soldered more than 25 years ago a kind of do it yourself "stereo" board ; it's soldered directly on the pins of the 3 voices of the YM and there's really no noticeable parasites.

Nicolas


They are cheap cables. Just checked again, especially drive activity is noisy, but there's a constant high pitch that changes with display (I think), definitely dirty.
Could be a problem with the phono outs or the Microwire system... not to diss Atari but it wouldn't surprise me :)

User avatar
troed
Atari God
Atari God
Posts: 1197
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: MFP / CPU clock ratio

Postby troed » Thu Jun 29, 2017 5:38 pm

Steven Seagal wrote:Right, I didn't know there were 2 different problems. Of course, there would have been complaints before...
But then it depends on what we listen to the tunes.


It does seem as if 7an's hi-hats specifically show this problem, but I'm quite sure more than one recent tune might've been made in emulator only by others and they don't really know how it sounds on target hw ...

For the ones interested:


All of these tunes have the same issue with the hi-hats being (much) too loud.

User avatar
npomarede
Atari God
Atari God
Posts: 1160
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: MFP / CPU clock ratio

Postby npomarede » Thu Jun 29, 2017 6:31 pm

Steven Seagal wrote:
npomarede wrote: Nope :) Noise frequency is correct in Hatari 2.0 and in all Hatari version since many years, it was just when rewriting the new cycle exact YM in the devel version that I forgot to take it into account.
But even so, Troed confirmed me that hi-hats sounds from 7an were still not correct, which is due to too much filtering.


Right, I didn't know there were 2 different problems. Of course, there would have been complaints before...
But then it depends on what we listen to the tunes.
One thing I thought: If we use Paulo's table, isn't STF filtering already factored in? Maybe you're applying double filtering?

Yes, that's something I thought about before, but that's the case for all volume tables : depending on whether the tables were measured directly on the YM pins or at a later stage (on the scart cable for example) then it's possible some filtering are applied twice in the emulators.

That's why I'm also planning to compare the wav of some simple sounds recorded on my STF with the emulated results to tune the filter coefficients to match real HW as closely as possible. But it's possible the "simple" (ie fast to compute) filters we use today might be not precise enough and some more computational intensive filters could be needed.
We'll see where it leads.

Nicolas

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1950
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: MFP / CPU clock ratio

Postby Steven Seagal » Thu Jun 29, 2017 7:49 pm

troed wrote:
It does seem as if 7an's hi-hats specifically show this problem, but I'm quite sure more than one recent tune might've been made in emulator only by others and they don't really know how it sounds on target hw ...

For the ones interested:


All of these tunes have the same issue with the hi-hats being (much) too loud.


I made a recording of the Closure tune in Steem, ogg format. Hi-hats sound too low if anything!
You do not have the required permissions to view the files attached to this post.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1950
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: MFP / CPU clock ratio

Postby Steven Seagal » Thu Jun 29, 2017 8:00 pm

npomarede wrote:Yes, that's something I thought about before, but that's the case for all volume tables : depending on whether the tables were measured directly on the YM pins or at a later stage (on the scart cable for example) then it's possible some filtering are applied twice in the emulators.

That's why I'm also planning to compare the wav of some simple sounds recorded on my STF with the emulated results to tune the filter coefficients to match real HW as closely as possible. But it's possible the "simple" (ie fast to compute) filters we use today might be not precise enough and some more computational intensive filters could be needed.
We'll see where it leads.

Nicolas


Not sure Paulo (ljbk) told how he measured but clearly he sampled 3 channels at once, so that could include all STF filters.
I found this here:
viewtopic.php?t=19370#p182287

"
Hello Russ,

here are the tables you need and that are the result of my 3 months of measurement.
Each of the tables is an array of 816 unique PSG volumes combinations for voices A,B and C."

3 months!
My guess is he took it from the SCART output (not the monitor output) directly into his soundcard input?

User avatar
troed
Atari God
Atari God
Posts: 1197
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: MFP / CPU clock ratio

Postby troed » Thu Jun 29, 2017 8:31 pm

Steven Seagal wrote:Not sure Paulo (ljbk) told how he measured but clearly he sampled 3 channels at once, so that could include all STF filters.
I found this here:
http://www.atari-forum.com/viewtopic.ph ... 70#p182287


FYI, I've recently used his tables and compared with ST Replay (same as Ray/TSCC, same as TCB) and Leonard's and in Hatari (have not run my code on target yet) they do sound better.

User avatar
npomarede
Atari God
Atari God
Posts: 1160
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: MFP / CPU clock ratio

Postby npomarede » Thu Jun 29, 2017 9:03 pm

Note that in all accuracy, the tone period used on each voice when measuring the output voltage could also be a factor to take into account (there can be slight difference if you measure all the volumes for a tone at very high freq (per=1 or 2 for example) and lower freq tone (per=200)).
Also, due to the fact that all 3 voices are wired together at the YM output (unlike on the MSX for example which also uses a similar AY chip), there can be some frequency feedbacks from one voice on the other voices.
In the end, this makes a complex model to emulate.

Ben also measured his own table for sc68, maybe he can explain how he did it and at which point the measures were taken.

Nicolas

tin
Atari freak
Atari freak
Posts: 70
Joined: Mon Jul 23, 2012 7:59 am
Contact:

Re: MFP / CPU clock ratio

Postby tin » Fri Jun 30, 2017 9:05 am

Hopefully not too unrelated:
There's a call for questions regarding an interview with the YM designer:

https://twitter.com/inversephase/status ... 5887932416

Seems that the interview will take place tomorrow (in whatever timezone).
Nicolas won't have time to ask questions, maybe someone else is up to the task?

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1950
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: MFP / CPU clock ratio

Postby Steven Seagal » Fri Jun 30, 2017 9:21 am

I have no twitter account (@sseagalofficial is an obvious fake).
Maybe it's possible to ask questions here and you would copy them on twitter?

tin
Atari freak
Atari freak
Posts: 70
Joined: Mon Jul 23, 2012 7:59 am
Contact:

Re: MFP / CPU clock ratio

Postby tin » Fri Jun 30, 2017 10:59 am

As a last resort, yes - my account is for following only, so I can't guarantee that there aren't any restrictions regarding the visibility of my posts.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1950
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: MFP / CPU clock ratio

Postby Steven Seagal » Fri Jun 30, 2017 12:44 pm

I typed some questions just in case. Not sure such questions are expected.
It's not vital, mind you, normally we know all the answers.


Those are very technical questions asked in the context of precise emulation of the Atari ST.

- Do the tone, noise and envelope counters count down or up?
(We think they count up)

- Is it true that tone, noise and envelope counters are not reset when the program changes the period?
(We think yes)

- Is it true the envelope counter is reset when the program changes the envelope shape?
(We think yes)

- Are the registers double buffered?
(We think no)

- Are the volumes different on the AY8910 and the YM2149?

- Is the noise different on the AY8910 and the YM2149?

- Does the YM2149 use a 17-bit shift register for noise?

ijor
Hardware Guru
Hardware Guru
Posts: 3095
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: MFP / CPU clock ratio

Postby ijor » Fri Jun 30, 2017 12:54 pm

Steven Seagal wrote:I typed some questions just in case. Not sure such questions are expected.
It's not vital, mind you, normally we know all the answers.


Interesting highly technical specific questions. But chances ... he just doesn't remember. And even if he answers because he THINKS he remembers well, he might remember things wrong. I have seen this many times, probably most of the time in these cases.

Of course, there are cases when the original developer not only remembers, but he still has original sources. So I would ask: "Do you have sources, schematics or layout files?" :)

tin
Atari freak
Atari freak
Posts: 70
Joined: Mon Jul 23, 2012 7:59 am
Contact:

Re: MFP / CPU clock ratio

Postby tin » Fri Jun 30, 2017 1:12 pm

Tweeted a link to Stevens post - I could not cramp all that into 140 characters ;)

And he tweeted a blog post about the backstory of that interview:
https://www.patreon.com/posts/12034473?utm_campaign=buffer&utm_content=buffer71267&utm_medium=social&utm_source=twitter.com

@ijor: well probably worth a try anyway ;-)

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1950
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: MFP / CPU clock ratio

Postby Steven Seagal » Fri Jun 30, 2017 1:38 pm

Yes I realise those questions are a bit "too much" (and forgetting about 140 limit) but this is appropriate for this thread.
We could also ask (probably will be done anyway) how he would defend the AY/YM against other chips like the SID.

tin
Atari freak
Atari freak
Posts: 70
Joined: Mon Jul 23, 2012 7:59 am
Contact:

Re: MFP / CPU clock ratio

Postby tin » Fri Jun 30, 2017 6:48 pm

We probably get a second extra technical interview:
https://twitter.com/inversephase/status ... 7199906818
And also worth mentioning:
https://twitter.com/inversephase/status ... 0611084292

So there's more time to collect questions. Thanks alot for your help, Steven!

tin
Atari freak
Atari freak
Posts: 70
Joined: Mon Jul 23, 2012 7:59 am
Contact:

Re: MFP / CPU clock ratio

Postby tin » Sun Jul 02, 2017 12:12 pm

Moved the interview thing to it's own topic (the first one took place, as it seems):
viewtopic.php?f=18&t=31886#p321317

User avatar
BenOVR
Atariator
Atariator
Posts: 25
Joined: Wed Nov 02, 2016 7:54 pm
Contact:

Re: MFP / CPU clock ratio

Postby BenOVR » Tue Jul 04, 2017 6:33 am

npomarede wrote:
npomarede wrote:In summary, measures on a real YM shows that most documentation / emulation are wrong or incomplete ; period counts up from 0 to max_per, noise counter is incremented twice slower than tone counter and writing to envwave register does both a restart of the wave pattern and a new phase.
The only thing I can't measure by recording my STF output to a wav file is whether per=0 gives the same result as per=1 for tone generator (it's the case for noise and env). It would require a logic analyzer to sample up to 125 or 250 kHz.

All those changes are included in the next version of Hatari for improved sound accuracy.

Nicolas

Hi
'tin' made some measures of a test program I sent him using a signal analyzer, and this confirms that per=0 gives the same output signal a per=1 for tone generator.
So, hopefully, all the "logical" work of the YM2149 should now be known.
The remaining part that can make a difference is the filtering method to mimic the digital->analog output of the YM2149 ,which can be very subjective depending on what everyone used to hear on his own speaker / CRT screen back then.

Nicolas


Good to know. Again that's already what sc68 was doing. I must say I'm a bit surprised it turned out this way.

FedePede04
Atari Super Hero
Atari Super Hero
Posts: 951
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: MFP / CPU clock ratio

Postby FedePede04 » Tue Jul 11, 2017 6:58 am

npomarede wrote:
The important part is to determine how the YM2149 handles the tone per value to switch phase on every 1/2 per. AY doc (from which YM2149 is derived) says the counter goes downward, starting at tone_per.until it reaches 0. But this models seemed wrong when emulating some musics and other emulators (MAME) says the counter goes upward, but there's no reference about how it was measured.



Hi Nicolas
my emulator have always emulate all clk cycles, and i have try the most, but it was first that you told me long ago that it was a count up, that i got it to work 100%,
and after you it told me, i use a little time to think over it, and suddenly the penny drop.

let say that it is a count down and switch Rapid between 2 tone period 4095 and 4094,
then you will get no sound, because you will contently will add a new value to the count down (pulse reset).
to avoid that you manual have to switch the pulse with the freq change, and that wont work either,
because you will get clicks, for when you manually change the pulse, you done know if the last pulse have only been there for 1 or 4094 count.
And if has only have been for 1, it will produce a spike of one data.

but if you count up. you wont have any of the problem of the about.
let say again you have tone running with a counter of 20 and you change the freq so the counter will become 10 what happen is

if the tone position is eg. 8 it will keep counting to it reach 10.
if the tone position is eg. 10 or about it will change immediately.

so if the the counter position lets say it is 16. the periods before freq change are 20, current one will be 16, and the period after will be 10.
so you wont know exactly then the pulse change.

if you sample the output from an Atari you will see that it is what happen, that you have period with weird lengths between freq changes.

i hope you get what i mean, my English is still no the best ;)
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

User avatar
npomarede
Atari God
Atari God
Posts: 1160
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: MFP / CPU clock ratio

Postby npomarede » Tue Jul 11, 2017 8:30 am

Hi
thanks for your input, but if you read the rest of this thread, you will see that I finally measured this precisely on my STF and that we're now 100% sure that counter goes up (this was measured using a kind of sync-lock code (as for fullscreen) to precisely change period counter with a precision of 4 cpu cycles).
Nicolas

FedePede04
Atari Super Hero
Atari Super Hero
Posts: 951
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: MFP / CPU clock ratio

Postby FedePede04 » Tue Jul 11, 2017 8:42 am

npomarede wrote:Hi
thanks for your input, but if you read the rest of this thread, you will see that I finally measured this precisely on my STF and that we're now 100% sure that counter goes up (this was measured using a kind of sync-lock code (as for fullscreen) to precisely change period counter with a precision of 4 cpu cycles).
Nicolas


you also are always helping others and ME :cheers: , so i just think that the least I could was share my experience with you. :)

i Amid I did not read the whole thread, i was on holiday when this thread was made, i just took a notice that i would answer it, when i got home..... :D
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 3 guests