inhibit note on if user has edited pattern

issue #82
untested
This commit is contained in:
tildearrow 2022-02-08 13:31:57 -05:00
parent bf537881ce
commit dea79c2adb
2 changed files with 6 additions and 3 deletions

View file

@ -49,7 +49,7 @@ struct DivChannelState {
int vibratoDepth, vibratoRate, vibratoPos, vibratoDir, vibratoFine;
int tremoloDepth, tremoloRate, tremoloPos;
unsigned char arp, arpStage, arpTicks;
bool doNote, legato, portaStop, keyOn, keyOff, nowYouCanStop, stopOnOff, arpYield, delayLocked, inPorta, scheduledSlideReset, shorthandPorta;
bool doNote, legato, portaStop, keyOn, keyOff, nowYouCanStop, stopOnOff, arpYield, delayLocked, inPorta, scheduledSlideReset, shorthandPorta, noteOnInhibit;
DivChannelState():
note(-1),
@ -88,7 +88,8 @@ struct DivChannelState {
delayLocked(false),
inPorta(false),
scheduledSlideReset(false),
shorthandPorta(false) {}
shorthandPorta(false),
noteOnInhibit(false) {}
};
struct DivNoteEvent {

View file

@ -727,7 +727,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
} else {
if (chan[i].inPorta && chan[i].keyOn && !chan[i].shorthandPorta) {
chan[i].portaNote=chan[i].note;
} else {
} else if (!chan[i].noteOnInhibit) {
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,chan[i].note,chan[i].volume>>8));
}
}
@ -747,6 +747,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
}
chan[i].nowYouCanStop=true;
chan[i].shorthandPorta=false;
chan[i].noteOnInhibit=false;
// post effects
for (int j=0; j<song.pat[i].effectRows; j++) {
@ -868,6 +869,7 @@ bool DivEngine::nextTick(bool noAccum) {
if (note.on) {
dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,note.channel,note.ins,1));
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,note.channel,note.note));
chan[note.channel].noteOnInhibit=true;
} else {
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,note.channel));
}