el diego 2 finally plays back correctly

ALMOST
This commit is contained in:
tildearrow 2021-12-27 16:31:16 -05:00
parent 4f2ce0f907
commit 65444d4a99
10 changed files with 20 additions and 13 deletions

View file

@ -111,7 +111,7 @@ void DivPlatformPCE::tick() {
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
//DivInstrument* ins=parent->getIns(chan[i].ins);
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>4095) chan[i].freq=4095;
if (chan[i].note>0x5d) chan[i].freq=0x01;
chWrite(i,0x02,chan[i].freq&0xff);