when the fix breaks something

This commit is contained in:
tildearrow 2021-12-08 01:16:29 -05:00
parent db46dd79d2
commit 4eec990ec1
8 changed files with 24 additions and 9 deletions

View File

@ -820,13 +820,19 @@ bool DivEngine::init(String outName) {
if (dispatch->isStereo()) {
for (int i=0; i<got.bufsize; i++) {
ilBuffer[i<<1]=bbOut[0][i];
ilBuffer[1+(i<<1)]=bbOut[1][i];
if (bbOut[0][i]<-16384) bbOut[0][i]=-16384;
if (bbOut[0][i]>16383) bbOut[0][i]=16383;
ilBuffer[i<<1]=bbOut[0][i]*2;
if (bbOut[1][i]<-16384) bbOut[1][i]=-16384;
if (bbOut[1][i]>16383) bbOut[1][i]=16383;
ilBuffer[1+(i<<1)]=bbOut[1][i]*2;
}
} else {
for (int i=0; i<got.bufsize; i++) {
ilBuffer[i<<1]=bbOut[0][i];
ilBuffer[1+(i<<1)]=bbOut[0][i];
if (bbOut[0][i]<-16384) bbOut[0][i]=-16384;
if (bbOut[0][i]>16383) bbOut[0][i]=16383;
ilBuffer[i<<1]=bbOut[0][i]*2;
ilBuffer[1+(i<<1)]=bbOut[0][i]*2;
}
}

View File

@ -89,18 +89,22 @@ void DivMacroInt::init(DivInstrument* which) {
if (ins->std.volMacroLen>0) {
hadVol=true;
hasVol=true;
willVol=true;
}
if (ins->std.arpMacroLen>0) {
hadArp=true;
hasArp=true;
willArp=true;
}
if (ins->std.dutyMacroLen>0) {
hadDuty=true;
hasDuty=true;
willDuty=true;
}
if (ins->std.waveMacroLen>0) {
hadWave=true;
hasWave=true;
willWave=true;
}
if (ins->std.arpMacroMode) {

View File

@ -11,6 +11,7 @@ class DivMacroInt {
bool hasVol, hasArp, hasDuty, hasWave;
bool hadVol, hadArp, hadDuty, hadWave;
bool finishedVol, finishedArp, finishedDuty, finishedWave;
bool willVol, willArp, willDuty, willWave;
bool arpMode;
void next();
void init(DivInstrument* which);
@ -36,6 +37,10 @@ class DivMacroInt {
finishedArp(false),
finishedDuty(false),
finishedWave(false),
willVol(false),
willArp(false),
willDuty(false),
willWave(false),
arpMode(false) {}
};

View File

@ -190,7 +190,7 @@ int DivPlatformC64::dispatch(DivCommand c) {
sid.write(c.chan*7+4,(chan[c.chan].wave<<4)|(chan[c.chan].ring<<2)|(chan[c.chan].sync<<1)|chan[c.chan].active);
break;
case DIV_CMD_LEGATO:
chan[c.chan].baseFreq=round(FREQ_BASE*pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].baseFreq=round(FREQ_BASE*pow(2.0f,((float)(c.value+((chan[c.chan].std.willArp && !chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
break;

View File

@ -238,7 +238,7 @@ int DivPlatformGB::dispatch(DivCommand c) {
}
case DIV_CMD_LEGATO:
if (c.chan==3) break;
chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((chan[c.chan].std.willArp && !chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
break;

View File

@ -250,7 +250,7 @@ int DivPlatformNES::dispatch(DivCommand c) {
}
case DIV_CMD_LEGATO:
if (c.chan==3) break;
chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((chan[c.chan].std.willArp && !chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
break;

View File

@ -235,7 +235,7 @@ int DivPlatformPCE::dispatch(DivCommand c) {
break;
}
case DIV_CMD_LEGATO:
chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(c.value+((chan[c.chan].std.willArp && !chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
break;

View File

@ -140,7 +140,7 @@ int DivPlatformSMS::dispatch(DivCommand c) {
updateSNMode=true;
break;
case DIV_CMD_LEGATO:
chan[c.chan].baseFreq=round(1712.0f/pow(2.0f,((float)(c.value+((!chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].baseFreq=round(1712.0f/pow(2.0f,((float)(c.value+((chan[c.chan].std.willArp && !chan[c.chan].std.arpMode)?(chan[c.chan].std.arp-12):(0)))/12.0f)));
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
break;