early implementation of global pitch

apparently this requires a rewrite of the pitch logic...
This commit is contained in:
tildearrow 2021-12-27 15:22:01 -05:00
parent a0a27e91f3
commit f32c2fa06b

View file

@ -502,6 +502,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
if (chan[i].pitch<-128) chan[i].pitch=-128; if (chan[i].pitch<-128) chan[i].pitch=-128;
if (chan[i].pitch>127) chan[i].pitch=127; if (chan[i].pitch>127) chan[i].pitch=127;
} }
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))); dispatchCmd(DivCommand(DIV_CMD_PITCH,i,chan[i].pitch+(((chan[i].vibratoDepth*vibTable[chan[i].vibratoPos]*chan[i].vibratoFine)>>4)/15)));
break; break;
case 0xea: // legato mode case 0xea: // legato mode
@ -520,6 +521,13 @@ void DivEngine::processRow(int i, bool afterDelay) {
extValue=effectVal; extValue=effectVal;
extValuePresent=true; extValuePresent=true;
break; break;
case 0xef: // global pitch
globalPitch+=(signed char)(effectVal-0x80)*120;
printf("setting global pitch to %d\n",globalPitch);
for (int i=0; i<chans; i++) {
chan[i].pitch+=globalPitch;
}
break;
} }
} }