We use Deflemask to author SN76489 chip music, for which support is aimed mainly at NTSC Sega Master System.
We export these tunes as VGMs from Deflemask and then to get them working on a BBC Micro we have to do some shenanigans because the BBC version of the SN76489 has two key differences from the SMS:
- It is clocked at 4Mhz not 3.58Mhz
- It has a 15-bit linear-feedback shift register (LFSR) for noise channel generation (the SMS version has 16-bits).
Because the squarewave output of the sound chip is driven by its clockspeed, to transpose frequencies from NTSC to 4Mhz we have to adjust every pitch value sent to the chip registers. This is done mathematically by converting the NTSC pitch register value to Hz and then calculating the equivalent pitch register value on a 4Mhz clocked chip to deliver the same Hz frequency.
That bit is easy (ish).
The tricky bit is when musicians use the tuned periodic noise function on the chip to create basslines. In this scenario channel 2 pitch controls the pitch of t