| |
The Phantom
Registered: Jan 2004 Posts: 360 |
Playing PAL music in NTSC...
Ok people, have a tough one here, well, at least for me.
A long while ago, Fungus taught me how to play PAL music on NTSC. A few minutes ago, I compared something I was working on in both PAL and NTSC and the difference was staggering.
Here's the routine...
fixit
lda #$06
beq reset
dec fixit+$01
jmp $1003 (play music)
reset
lda #$06
sta fixit+$01
rts
I'd like to play music in NTSC as it sounds in PAL, as it SHOULD sound, any suggestions?
Thanks in advance |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
use a timer interrupt at 50hz :) |
| |
Devia
Registered: Oct 2004 Posts: 401 |
You may be able to play tunes at PAL speed on NTSC systems, but they will still not sound the same as the SID is clocked differently. The notes will not have the same pitch as on PAL.
In theory this could be fixed by changing the note frequency table of the player, but in many cases, e.g. tone portamento, it would not be enough for a 100% conversion.
|
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
I might be completely wrong now, in case I missed something, but I *think* the timer should be set to $4FB3, using a timer interrupt, to play at the correct speed at least. As far as I understand, that would lead to a "framerate" of the music being 50.12454212 hz (on an NTSC machine), like the PAL framerate...
|
| |
6R6
Registered: Feb 2002 Posts: 245 |
Sidplay64 V0.4
Will play sid songs in ntsc or pal speed on your c64.
Its using the timer thingy mentioned..
|
| |
Steppe
Registered: Jan 2002 Posts: 1510 |
Quote: I might be completely wrong now, in case I missed something, but I *think* the timer should be set to $4FB3, using a timer interrupt, to play at the correct speed at least. As far as I understand, that would lead to a "framerate" of the music being 50.12454212 hz (on an NTSC machine), like the PAL framerate...
Frantic, how did you calculate that? A PAL C64 has $4CC8 cycles, and that should be the value to put into the CIA timer to get a tune to play a PAL speed. 63 cylces a line and 312 lines, right? |
| |
assiduous Account closed
Registered: Jun 2007 Posts: 343 |
pal is 985.248 khz,ntsc is 1022.7 khz,it takes shorter time for an ntsc machine to execute a clock cycle. Frantic`s calculations are correct:
985248/1022700 == 0.963379...
19656(4cc8)/20403(4fb3) == 0.963387... |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Glad to hear that my brain works. ;)
Also.. Note that I said $4FB3 rather than $4fB4.. just like you have to use $4cc7 as a timer value rather than $4cc8 to get $4cc8 cycles period. (Just to keep things straight - whether we are talking what to set the timer to, or whether we are talking about the number of cycles).
|
| |
Steppe
Registered: Jan 2002 Posts: 1510 |
Thanks for clearing that up! |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Just to act like Mr Exemplary, I also wrote this stuff down in a small article on codebase, just to show how I think codebase should/can be used. ;)
http://codebase64.org/doku.php?id=base:playing_music_on_pal_and.. |