base:playing_music_on_pal_and_ntsc
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
base:playing_music_on_pal_and_ntsc [2015-08-14 04:56] – riq | base:playing_music_on_pal_and_ntsc [2015-08-14 07:13] – [Addendum: Playing PAL music on PAL-N (drean)] riq | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Playing music on PAL and NTSC ====== | ||
+ | By FTC/HT | ||
+ | |||
+ | This article deals (briefly) with the question of how to play PAL tunes on a NTSC system, and vice versa. Most music players are called once a frame in order to update the music which is playing. One PAL frame is 312*63=19656 | ||
+ | |||
+ | What timer values do we need to use for our timer interrupts in order to play our PAL and NTSC tunes correctly on the opposite kind of system? | ||
+ | |||
+ | PAL/NTSC speed ratio: | ||
+ | < | ||
+ | 985248 / 1022727 = 0.963353857 | ||
+ | </ | ||
+ | |||
+ | So... In order to play a PAL tune on a NTSC system, in " | ||
+ | |||
+ | < | ||
+ | 0.963353857 * 19656 = 18935.6 ($49F7) ...or rather $49F7, since the timer | ||
+ | counts from 0, and not from 1. | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | 19656 / 0.963353857 = 20403.717551 ($4FB3) ...or rather $4FB2, since the timer | ||
+ | counts from 0, and not from 1. | ||
+ | </ | ||
+ | |||
+ | |||
+ | Let's do the opposite calculation too: | ||
+ | |||
+ | < | ||
+ | 1022727 / 985248 = 1.038040169 | ||
+ | |||
+ | 1.038040169 * 17095 = 17745.3 ($4551) ...or rather $4550, since the timer | ||
+ | counts from 0, and not from 1. | ||
+ | </ | ||
+ | |||
+ | This means, playing a NTSC tune on a PAL machine requires the timer to be set to $4550. | ||
+ | |||
+ | Note that there are still other differences regarding music playback on PAL and NTSC machines. For example, the differing system clock speeds make the pitch come out slightly different on these two systems. This can't be compensated for in a self-evident manner, since the pitch is not a linear function on the SID, so you can't just add an " | ||
+ | |||
+ | Also see [[http:// | ||
+ | |||
+ | Good luck! | ||
+ | |||
+ | /FTC | ||
+ | |||
+ | |||
+ | ===== Addendum: Playing PAL music on PAL-N (drean) ===== | ||
+ | |||
+ | Ratio between PAL and PAL-N: | ||
+ | < | ||
+ | |||
+ | So… In order to play a PAL tune on a PAL-N system, in “PAL” speed, you should use the following timer value in your timer interrupt: | ||
+ | < | ||
+ | 19656 / 0.9626749003 = 20418.107914 ($4FC2) ...or rather $4FC1, since the timer | ||
+ | counts from 0, and not from 1. | ||
+ | </ | ||
+ | |||
+ | |||
+ | /riq |
base/playing_music_on_pal_and_ntsc.txt · Last modified: 2021-06-10 13:30 by ftc