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) {

View File

@ -522,10 +522,14 @@ void DivEngine::processRow(int i, bool afterDelay) {
extValuePresent=true;
break;
case 0xef: // global pitch
globalPitch+=(signed char)(effectVal-0x80)*120;
for (int i=0; i<chans; i++) {
chan[i].pitch-=globalPitch;
}
globalPitch+=(signed char)(effectVal-0x80)*(120-globalPitch/28);
printf("setting global pitch to %d\n",globalPitch);
for (int i=0; i<chans; i++) {
chan[i].pitch+=globalPitch;
dispatchCmd(DivCommand(DIV_CMD_PITCH,i,chan[i].pitch+(((chan[i].vibratoDepth*vibTable[chan[i].vibratoPos]*chan[i].vibratoFine)>>4)/15)));
}
break;
}

View File

@ -1985,7 +1985,6 @@ void FurnaceGUI::doUndo() {
updateScroll(cursor.y);
e->setOrder(us.order);
}
break;
}