improve 03xx accuracy
portamento stops if same note
This commit is contained in:
parent
2cb7152c06
commit
97a00c7efd
|
@ -23,7 +23,7 @@ enum DivAudioEngines {
|
||||||
|
|
||||||
struct DivChannelState {
|
struct DivChannelState {
|
||||||
std::vector<DivDelayedCommand> delayed;
|
std::vector<DivDelayedCommand> delayed;
|
||||||
int note, pitch, portaSpeed, portaNote;
|
int note, oldNote, pitch, portaSpeed, portaNote;
|
||||||
int volume, volSpeed, cut, rowDelay, volMax;
|
int volume, volSpeed, cut, rowDelay, volMax;
|
||||||
int delayOrder, delayRow;
|
int delayOrder, delayRow;
|
||||||
int vibratoDepth, vibratoRate, vibratoPos, vibratoDir, vibratoFine;
|
int vibratoDepth, vibratoRate, vibratoPos, vibratoDir, vibratoFine;
|
||||||
|
@ -33,6 +33,7 @@ struct DivChannelState {
|
||||||
|
|
||||||
DivChannelState():
|
DivChannelState():
|
||||||
note(-1),
|
note(-1),
|
||||||
|
oldNote(-1),
|
||||||
pitch(0),
|
pitch(0),
|
||||||
portaSpeed(-1),
|
portaSpeed(-1),
|
||||||
portaNote(-1),
|
portaNote(-1),
|
||||||
|
|
|
@ -348,6 +348,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
}
|
}
|
||||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,i));
|
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,i));
|
||||||
} else if (!(pat->data[whatRow][0]==0 && pat->data[whatRow][1]==0)) {
|
} else if (!(pat->data[whatRow][0]==0 && pat->data[whatRow][1]==0)) {
|
||||||
|
chan[i].oldNote=chan[i].note;
|
||||||
chan[i].note=pat->data[whatRow][0]+pat->data[whatRow][1]*12;
|
chan[i].note=pat->data[whatRow][0]+pat->data[whatRow][1]*12;
|
||||||
if (!chan[i].keyOn) {
|
if (!chan[i].keyOn) {
|
||||||
if (dispatch->keyOffAffectsArp(i)) {
|
if (dispatch->keyOffAffectsArp(i)) {
|
||||||
|
@ -428,8 +429,13 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
chan[i].portaSpeed=-1;
|
chan[i].portaSpeed=-1;
|
||||||
dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false));
|
dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false));
|
||||||
} else {
|
} else {
|
||||||
chan[i].portaNote=chan[i].note;
|
if (chan[i].note==chan[i].oldNote) {
|
||||||
chan[i].portaSpeed=effectVal;
|
chan[i].portaNote=chan[i].note;
|
||||||
|
chan[i].portaSpeed=0;
|
||||||
|
} else {
|
||||||
|
chan[i].portaNote=chan[i].note;
|
||||||
|
chan[i].portaSpeed=effectVal;
|
||||||
|
}
|
||||||
chan[i].portaStop=true;
|
chan[i].portaStop=true;
|
||||||
chan[i].doNote=false;
|
chan[i].doNote=false;
|
||||||
chan[i].stopOnOff=true;
|
chan[i].stopOnOff=true;
|
||||||
|
@ -727,12 +733,14 @@ bool DivEngine::nextTick() {
|
||||||
if (chan[i].portaSpeed>0) {
|
if (chan[i].portaSpeed>0) {
|
||||||
if (dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed,chan[i].portaNote))==2 && chan[i].portaStop) {
|
if (dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed,chan[i].portaNote))==2 && chan[i].portaStop) {
|
||||||
chan[i].portaSpeed=0;
|
chan[i].portaSpeed=0;
|
||||||
|
chan[i].oldNote=chan[i].note;
|
||||||
chan[i].note=chan[i].portaNote;
|
chan[i].note=chan[i].portaNote;
|
||||||
dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note));
|
dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[i].cut>0) {
|
if (chan[i].cut>0) {
|
||||||
if (--chan[i].cut<1) {
|
if (--chan[i].cut<1) {
|
||||||
|
chan[i].oldNote=chan[i].note;
|
||||||
chan[i].note=-1;
|
chan[i].note=-1;
|
||||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,i));
|
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,i));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue