I was thinking of just playing a sine or square wave or something on all channels, sample it and make sure the phase is ok but I don't have a working setup for doing that.
Yes, I'd try a saw teeth, it is easier to see the lack or the duplications of samples.
Anyway you say:
;; 7648Hz in 60Hz mode
Period: equ 1873
Accordingly to the Manuel's site and to the WIKI the Fs is linked to the period by
Fs = Fc/(P+1)
so
P = -1 +Fc/Fs
Ur numbers does not fit in this, is it wanted?
Not really. I think I calculated the numbers slightly wrong. But I have no idea why it sounds ok with these numbers This is basically the intended calculation (but I may have put some wrong number in there):
C = Cycles per scanline = 228
S = Scanlines = 262
Fs = Fc / (C * S)
and from wiki, Fs = Fc/ (32 * (P+1))
so:
Fc / (C * S) = Fc / (32 * (P + 1)
=>
P = (C * S - 1) / 32
When I calculated this earlier I used 263 scanlines per frame which is not correct. The correct value should be:
P = ( 228 * 262 - 1) / 32 = 1867
But a period slightly longer is actually wanted to avoid that the phase wraps before the samples are updated. So a period of 1873 is probably quite good since it will reset the phase after 31.9 samples.
Actually, I get
P = C*S/32 - 1
that gives 1.865,75, i.e. I'd say 1.866 and not 1867
More in detail
Fp = Fc / C / S
Fs = Fp * 32
from Wiki
Fs = Fc / (P+1) => P = Fc / Fs -1 = Fc / Fp /32 -1 = C*S/32 - 1
I'm sorry that I've had no time to be involved in this. Last weekend I wanted to put together the MSX Info Update video and now I've been busy with my work.
It is anyway great to see that you started to solve this puzzle. I did some tests with this method last year(?), but I really didn't manage to get the timing right. It seems that you have already advanced beyond what I managed to make...
I'm really eager to hear how well this method can be made to work!
NYYRIKKI, you should check out
http://www.bluemsx.com/demos/sccplay_20071023.zip
I think this is the version that has a fully working workaround for some SCC issues and the result is quite amazing on a real MSX. If these roms doesn't sound good I probably linked the wrong version but I believe this is the latest and greatest using the rotating channel 4.
The version discussed last two pages doesn't sound as good and doesn't work well on a real SCC yet but it has other great advantages, like only requiring updates in VBLANK and its using only 4% cpu to play decent samples (If the timing can be fixed)
@ARTRAG, yes you're right. I did a small calculation error. The period needs to be sligthly bigger than the exact value to avoid sample 0 to be played too early, so the 1873 period is quite good (at least not bad).
Strange 1.866 should be the right value but it does not work if you set less than 1.873 ...
have you results from the saw teeth test input ?
can you post some files to peek into what is happening?
Are we sure about timing in emulators ?
could a difference in timing the reason for the player not working on the real thing?
