prepare for proper center rate

the correct rate is 8372Hz rather than 8363Hz
sadly this will require a compat flag so I am not making this change
effective until 0.7

issue #2347
This commit is contained in:
tildearrow 2025-02-06 02:14:21 -05:00
parent b95f9885a4
commit 9dee51851f
39 changed files with 57 additions and 46 deletions

View file

@ -119,7 +119,7 @@ void DivPlatformSegaPCM::tick(bool sysTick) {
double off=1.0;
if (chan[i].pcm.sample>=0 && chan[i].pcm.sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(chan[i].pcm.sample);
off=(double)s->centerRate/8363.0;
off=(double)s->centerRate/parent->getCenterRate();
}
chan[i].pcm.freq=MIN(255,((rate*0.5)+(off*parent->song.tuning*pow(2.0,double(chan[i].freq+512)/(128.0*12.0)))*255)/rate)+(oldSlides?chan[i].pitch2:0);
rWrite(7+(i<<3),chan[i].pcm.freq);