fix arpeggio not happening during slide on SMS

This commit is contained in:
tildearrow 2022-02-07 00:30:15 -05:00
parent 7599f99ca0
commit e25f5b229c
4 changed files with 21 additions and 10 deletions

View file

@ -308,7 +308,9 @@ int DivPlatformGB::dispatch(DivCommand c) {
chan[c.chan].note=c.value;
break;
case DIV_CMD_PRE_PORTA:
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
if (chan[c.chan].active) {
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
}
chan[c.chan].inPorta=c.value;
break;
case DIV_CMD_GB_SWEEP_DIR:

View file

@ -33,14 +33,16 @@ void DivPlatformSMS::tick() {
rWrite(0x90|(i<<5)|(isMuted[i]?15:(15-(chan[i].outVol&15))));
}
if (chan[i].std.hadArp) {
if (chan[i].std.arpMode) {
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp);
chan[i].actualNote=chan[i].std.arp;
} else {
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp);
chan[i].actualNote=chan[i].note+chan[i].std.arp;
if (!chan[i].inPorta) {
if (chan[i].std.arpMode) {
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp);
chan[i].actualNote=chan[i].std.arp;
} else {
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp);
chan[i].actualNote=chan[i].note+chan[i].std.arp;
}
chan[i].freqChanged=true;
}
chan[i].freqChanged=true;
} else {
if (chan[i].std.arpMode && chan[i].std.finishedArp) {
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
@ -163,7 +165,10 @@ int DivPlatformSMS::dispatch(DivCommand c) {
}
}
chan[c.chan].freqChanged=true;
if (return2) return 2;
if (return2) {
chan[c.chan].inPorta=false;
return 2;
}
break;
}
case DIV_CMD_STD_NOISE_MODE:
@ -178,6 +183,7 @@ int DivPlatformSMS::dispatch(DivCommand c) {
break;
case DIV_CMD_PRE_PORTA:
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
chan[c.chan].inPorta=c.value;
break;
case DIV_CMD_GET_VOLMAX:
return 15;

View file

@ -9,7 +9,7 @@ class DivPlatformSMS: public DivDispatch {
struct Channel {
int freq, baseFreq, pitch, note, actualNote;
unsigned char ins;
bool active, insChanged, freqChanged, keyOn, keyOff;
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta;
signed char vol, outVol;
DivMacroInt std;
Channel():
@ -24,6 +24,7 @@ class DivPlatformSMS: public DivDispatch {
freqChanged(false),
keyOn(false),
keyOff(false),
inPorta(false),
vol(15),
outVol(15) {}
};

View file

@ -551,6 +551,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].portaNote=-1;
chan[i].portaSpeed=-1;
chan[i].inPorta=false;
dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false));
} else {
chan[i].portaNote=song.limitSlides?disCont[dispatchOfChan[i]].dispatch->getPortaFloor(dispatchChanOfChan[i]):-60;
chan[i].portaSpeed=effectVal;
@ -559,6 +560,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].stopOnOff=false;
chan[i].scheduledSlideReset=false;
chan[i].inPorta=false;
dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true));
}
break;
case 0x03: // portamento