fix note on sometimes not working in jam mode

This commit is contained in:
tildearrow 2022-08-27 00:37:32 -05:00
parent efd5cc0dac
commit d577755035
3 changed files with 30 additions and 13 deletions

View file

@ -3210,7 +3210,7 @@ bool DivEngine::moveSampleDown(int which) {
void DivEngine::noteOn(int chan, int ins, int note, int vol) {
if (chan<0 || chan>=chans) return;
BUSY_BEGIN;
pendingNotes.push(DivNoteEvent(chan,ins,note,vol,true));
pendingNotes.push_back(DivNoteEvent(chan,ins,note,vol,true));
if (!playing) {
reset();
freelance=true;
@ -3222,7 +3222,7 @@ void DivEngine::noteOn(int chan, int ins, int note, int vol) {
void DivEngine::noteOff(int chan) {
if (chan<0 || chan>=chans) return;
BUSY_BEGIN;
pendingNotes.push(DivNoteEvent(chan,-1,-1,-1,false));
pendingNotes.push_back(DivNoteEvent(chan,-1,-1,-1,false));
if (!playing) {
reset();
freelance=true;
@ -3274,7 +3274,7 @@ void DivEngine::autoNoteOn(int ch, int ins, int note, int vol) {
if ((!midiPoly) || (isViable[finalChan] && chan[finalChan].midiNote==-1 && (insInst->type==DIV_INS_OPL || getChannelType(finalChan)==finalChanType || notInViableChannel))) {
chan[finalChan].midiNote=note;
chan[finalChan].midiAge=midiAgeCounter++;
pendingNotes.push(DivNoteEvent(finalChan,ins,note,vol,true));
pendingNotes.push_back(DivNoteEvent(finalChan,ins,note,vol,true));
return;
}
if (++finalChan>=chans) {
@ -3295,7 +3295,7 @@ void DivEngine::autoNoteOn(int ch, int ins, int note, int vol) {
chan[candidate].midiNote=note;
chan[candidate].midiAge=midiAgeCounter++;
pendingNotes.push(DivNoteEvent(candidate,ins,note,vol,true));
pendingNotes.push_back(DivNoteEvent(candidate,ins,note,vol,true));
}
void DivEngine::autoNoteOff(int ch, int note, int vol) {
@ -3307,7 +3307,7 @@ void DivEngine::autoNoteOff(int ch, int note, int vol) {
//if (ch<0 || ch>=chans) return;
for (int i=0; i<chans; i++) {
if (chan[i].midiNote==note) {
pendingNotes.push(DivNoteEvent(i,-1,-1,-1,false));
pendingNotes.push_back(DivNoteEvent(i,-1,-1,-1,false));
chan[i].midiNote=-1;
}
}
@ -3321,7 +3321,7 @@ void DivEngine::autoNoteOffAll() {
}
for (int i=0; i<chans; i++) {
if (chan[i].midiNote!=-1) {
pendingNotes.push(DivNoteEvent(i,-1,-1,-1,false));
pendingNotes.push_back(DivNoteEvent(i,-1,-1,-1,false));
chan[i].midiNote=-1;
}
}