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
1 changed files with 8 additions and 0 deletions

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>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)));
break;
case 0xea: // legato mode
@ -520,6 +521,13 @@ void DivEngine::processRow(int i, bool afterDelay) {
extValue=effectVal;
extValuePresent=true;
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;
}
}