NES: fix high pitch being out of tune

This commit is contained in:
tildearrow 2022-02-17 21:59:48 -05:00
parent 7d9749d0ef
commit eafc3078cf
2 changed files with 4 additions and 4 deletions

View file

@ -4927,8 +4927,8 @@ int DivEngine::calcBaseFreq(double clock, double divider, int note, bool period)
int DivEngine::calcFreq(int base, int pitch, bool period, int octave) {
if (song.linearPitch) {
return period?
int(base*pow(2,-(double)pitch/(12.0*128.0))/(98.0+globalPitch*6.0)*98.0):
(int(base*pow(2,(double)pitch/(12.0*128.0))*(98+globalPitch*6))/98);
round(base*pow(2,-(double)pitch/(12.0*128.0))/(98.0+globalPitch*6.0)*98.0):
(round(base*pow(2,(double)pitch/(12.0*128.0))*(98+globalPitch*6))/98);
}
return period?
base-pitch: