mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 15:03:01 +00:00
NES: fix high pitch being out of tune
This commit is contained in:
parent
7d9749d0ef
commit
eafc3078cf
2 changed files with 4 additions and 4 deletions
|
@ -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:
|
||||
|
|
|
@ -198,9 +198,9 @@ void DivPlatformNES::tick() {
|
|||
int ntPos=chan[i].baseFreq;
|
||||
if (ntPos<0) ntPos=0;
|
||||
if (ntPos>252) ntPos=252;
|
||||
chan[i].freq=(parent->song.properNoiseLayout)?(15-(chan[i].baseFreq&15)):(noiseTable[ntPos]);
|
||||
chan[i].freq=(parent->song.properNoiseLayout)?(15-(chan[i].baseFreq&15)):(noiseTable[ntPos])-1;
|
||||
} else {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true);
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true)-1;
|
||||
if (chan[i].freq>2047) chan[i].freq=2047;
|
||||
}
|
||||
if (chan[i].keyOn) {
|
||||
|
|
Loading…
Reference in a new issue