better global pitch effect

still work in progress
This commit is contained in:
tildearrow 2021-12-27 16:15:11 -05:00
parent 11478fbdfe
commit 1605f4f3c0
3 changed files with 6 additions and 3 deletions

View file

@ -121,7 +121,7 @@ void DivPlatformNES::tick() {
if (i==3) { // noise
chan[i].freq=noiseTable[chan[i].baseFreq];
} else {
chan[i].freq=(chan[i].baseFreq*(ONE_SEMITONE-chan[i].pitch))/ONE_SEMITONE;
chan[i].freq=(chan[i].baseFreq*pow(2,(double)-chan[i].pitch/(12.0*128.0)));
if (chan[i].freq>2047) chan[i].freq=2047;
}
if (chan[i].keyOn) {