Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Copperhead ! (Registered 2024-05-08) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > NTSC/PAL agnostic music
2021-02-26 23:15
Raz
Account closed

Registered: Aug 2003
Posts: 16
NTSC/PAL agnostic music

My apologies if this has already been addressed: during 2020 I rewrote quite a bit of timer code to work with all variants of PAL and NTSC (including the odd-ball PAL65) - this was mainly due to a Gauntlet-like game project I started with may at some point mature into something neat.

However, I was considering making NTSC/PAL dual versions of some of my demo effect (including some so far unreleased stuff), but oddly enough the limitation I continue to come back to is not code but MUSIC:

How do the rest of you approach making a dual PAL/NTSC releases music-wise? As far as I know there are two main things to consider:

1) 60hz vs. 50hz
2) SID 6581 vs. SID 8580

Around point 1) I was considering (with some help of the musicians) that a solution would be to separate the tempo (progression of the tune) from the actually SID value tables. So that for PAL (50Hz) one version of per-frame SID values would be used for each sound and another would be used for NTSC, and the progression of the tune would then be make independent (e.g. on beats of 1/10 of a second which would be every 5/6 frames depending on the system).

Around point 2): Different filters etc? Which would you recommend?

Any feedback would be welcome
-Raz
2021-02-26 23:44
Krill

Registered: Apr 2002
Posts: 2852
For PAL vs. NTSC, the simplest solution is to simply call player with a 50 Hz timer interrupt, or call the PAL player only 5 out of 6 videoframes on NTSC when being bound to video frames.
This may sound okay or not. If not, some more modifications can be tried, such as modifying note durations for NTSC to be 20% longer, possibly using a fixed-point duration variable.
Then you might also want to modify filter and pulse sweep and similar step sizes.
Then the SID itself runs at a different clock frequency on NTSC, so the base note frequency table should also be adjusted accordingly, to avoid an ever so slightly detuned scale.

Artefacts exists as an NTSC incarnation as well, with modifications to the music player. There i only changed the base frequencies* and skipped the player call on every 6th video frame. The source is linked there, so you might want to have a look. :)

* Note that equal temperament is used there, which is rather uncommon. But PAL vs NTSC frequency settings differ by a fixed constant based on the ratio of the clock frequencies, which is in that source somewhere.
2021-02-26 23:46
Raz
Account closed

Registered: Aug 2003
Posts: 16
Hi Krill

Thanks for the feedback - I'll have a look at Artefacts =)

Cheers
-Raz
2021-02-26 23:51
TheRyk

Registered: Mar 2009
Posts: 2076
It's not that hard to do, IIRC PlayEm64 V1.2 Tools (and Music) Collection adjusts NTSC-flagged .SID to PAL files by extra-calls. Vice versa (after some code detecting PAL or NTSC) ain't any harder to code (in that case you skip jsr $play every so-and-so-manieth frame) :)

It's of course the sledge hammer approach

The 2nd question 6581 vs 8580 is harder. You can detect SID type but there are only few so-so solutions to adaot filter reg writes, more often than not this has to be done manually.
2021-02-27 00:04
Krill

Registered: Apr 2002
Posts: 2852
Yes, porting tunes between oldsid and newsid may even be quite impossible to get to sound close enough (by some definition), depending on the type of sounds used (new waveforms on newsid etc.). Some people have strong opinions about the superior SID version, too. :)
2021-02-27 00:07
TheRyk

Registered: Mar 2009
Posts: 2076
yeah not to speak of the golden ears that swear the REV makes all the difference ^^ (in fact same REVs even of same assembly line and date may vary noticeably in terms of filter feats and one SID depending on surrounding capacitor might sound differently on different boards) Pandora's black box...
2021-02-27 00:12
Krill

Registered: Apr 2002
Posts: 2852
I was talking about the differences in digital circuitry of 6581 vs 8580, though. Those arguments about the analogue differences with different revisions of either usually go a tad too much into audiophile esoteric cult stuff to me, mostly. :)
2021-02-27 00:14
TheRyk

Registered: Mar 2009
Posts: 2076
yeah "airy" versus "earthen" sounds... never quite got what those ppl are talkin about ^^ either I'm too deaf or they are whacko (or both)
2021-02-27 00:20
Raz
Account closed

Registered: Aug 2003
Posts: 16
Quote: I was talking about the differences in digital circuitry of 6581 vs 8580, though. Those arguments about the analogue differences with different revisions of either usually go a tad too much into audiophile esoteric cult stuff to me, mostly. :)

I was considering the "skip frame 6" approach, but though that might be too crude. But perhaps I should just test it out (I only have hardware for PAL).

An additional issue I ran across was the 6581 vs. 8580 issue: Just for fun I was considering making an NTSC version of Gumbo Revised (Gumbo Revised), and I'm a bit concerned here, that it sounds really terrible on 6581, and as I far as I know the majority of real NTSC systems has this chip.
2021-02-27 00:38
TheRyk

Registered: Mar 2009
Posts: 2076
Quoting Raz
I was considering the "skip frame 6" approach, but though that might be too crude. ...
Seriously, even the afore-mentioned "golden ears" won't notice ^^

However, there are people that believe to distinguish if sth is played at 50.00 or 49.?? Hz
2021-02-27 00:42
Krill

Registered: Apr 2002
Posts: 2852
Quoting TheRyk
Quoting Raz
I was considering the "skip frame 6" approach, but though that might be too crude. ...
Seriously, even the afore-mentioned "golden ears" won't notice ^^

However, there are people that believe to distinguish if sth is played at 50.00 or 49.?? Hz
Only skipping every 6th frame can sound noticeably different. I tried that and the other things i mentioned for Softwired but it still sounded weird on NTSC. Not sure if things like the hard restart need to be adjusted as well, ceased to bother before i went that far. =)
2021-02-27 09:42
Jammer

Registered: Nov 2002
Posts: 1289
Speaking of 8580 vs 6581, I'm recently a strong proponent of SID model detection at the very start of program runtime and patching music file accordingly. At least for game releases which have much broader audience with variety of SID models in their machines. I always start with 8580 version as basic one and later on create 6581 version with adjusted filter settings. Furthermore, I create diff file between 6581 and 8580 version with simple script and store it in convenient place. Diff shouldn't exceed 128b on average and SID detection is very straightforward. At least for Goat Tracker tunes ;)
2021-02-27 21:49
Raz
Account closed

Registered: Aug 2003
Posts: 16
A lot of good points in this thread - I'll do a bit more experimentation and come back here and post my observations.

Cheers
-Raz
2021-02-28 14:44
chatGPZ

Registered: Dec 2001
Posts: 11136
All this for an NTSC version that will be run by like 3 people? :)
2021-02-28 20:30
Raz
Account closed

Registered: Aug 2003
Posts: 16
Quote: All this for an NTSC version that will be run by like 3 people? :)

Well, I do it for the intellectual challenge, so even if audience is just one (me), then I'm happy.

-Raz
2021-03-01 15:54
c0zmo

Registered: Aug 2015
Posts: 10
Quote: Speaking of 8580 vs 6581, I'm recently a strong proponent of SID model detection at the very start of program runtime and patching music file accordingly. At least for game releases which have much broader audience with variety of SID models in their machines. I always start with 8580 version as basic one and later on create 6581 version with adjusted filter settings. Furthermore, I create diff file between 6581 and 8580 version with simple script and store it in convenient place. Diff shouldn't exceed 128b on average and SID detection is very straightforward. At least for Goat Tracker tunes ;)

Nice to hear that I could get you inspired, when I approached you with that exact idea a few years ago. ;)

I do that SID diffing for each and every tune I release as a standalone music, and I also did it for Game Art Beyond. I wrote a simple diffing routine like Jammer did, with the exception that I work on the real machine entirely. ;)

As for my 2SID Space Oddity [2sid], I did the same here but not for 6581/8580 patching, but for enabling two different addressing modes for the 2nd SID.

It is really not that much of a hassle, and I would love to see more composers supporting both chips. You can't make the tunes sound exactly the same, but you can at least make them pleasant to listen to, as on the 6581 all the latest filter-magic with drums and bassline is often almost inaudible. :)
2021-03-04 22:21
Zaz

Registered: Mar 2004
Posts: 33
FWIW, J(46) - SIDWAVE 30 Years Anniversary Music Disk is fully PAL/NTSC compatible.
Nothing too tricky, the note frequencies are replaced based on the video standard, and to avoid interfering with graphics-oriented raster interrupts, the music playback uses a rolling raster interrupt triggering at different part of the screen, to achieve a 50Hz cadence on a 60Hz display.
I did find by listening myself (no golden ear) that just playing 5 of 6 frames was definitely not good enough.
There have been no complaints so far, but then again maybe no NTSC user downloaded it :-)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Didi/Laxity
Fred/Channel 4
Flex/Artline Designs
icon/The Silents, Sp..
Guests online: 128
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 S!R  (9.7)
5 Faayd  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.065 sec.