apply delayed rows first (fixes #2014
This commit is contained in:
parent
5195f7562a
commit
61ddd29b1e
|
|
@ -552,7 +552,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
bool comparison=(song.delayBehavior==1)?(effectVal<=nextSpeed):(effectVal<(nextSpeed*(curSubSong->timeBase+1)));
|
bool comparison=(song.delayBehavior==1)?(effectVal<=nextSpeed):(effectVal<(nextSpeed*(curSubSong->timeBase+1)));
|
||||||
if (song.delayBehavior==2) comparison=true;
|
if (song.delayBehavior==2) comparison=true;
|
||||||
if (comparison) {
|
if (comparison) {
|
||||||
chan[i].rowDelay=effectVal+1;
|
chan[i].rowDelay=effectVal;
|
||||||
chan[i].delayOrder=whatOrder;
|
chan[i].delayOrder=whatOrder;
|
||||||
chan[i].delayRow=whatRow;
|
chan[i].delayRow=whatRow;
|
||||||
if (effectVal==nextSpeed) {
|
if (effectVal==nextSpeed) {
|
||||||
|
|
@ -1596,6 +1596,19 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
|
||||||
if (--subticks<=0) {
|
if (--subticks<=0) {
|
||||||
subticks=tickMult;
|
subticks=tickMult;
|
||||||
|
|
||||||
|
// apply delayed rows before potentially advancing to a new row, which would overwrite the
|
||||||
|
// delayed row's state before it has a chance to do anything. a typical example would be
|
||||||
|
// a delay scheduling a note-on to be simultaneous with the next row, and the next row also
|
||||||
|
// containing a delayed note. if we don't apply the delayed row first,
|
||||||
|
for (int i=0; i<chans; i++) {
|
||||||
|
// delay effects
|
||||||
|
if (chan[i].rowDelay>0) {
|
||||||
|
if (--chan[i].rowDelay==0) {
|
||||||
|
processRow(i,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stepPlay!=1) {
|
if (stepPlay!=1) {
|
||||||
tempoAccum+=(skipping && virtualTempoN<virtualTempoD)?virtualTempoD:virtualTempoN;
|
tempoAccum+=(skipping && virtualTempoN<virtualTempoD)?virtualTempoD:virtualTempoN;
|
||||||
while (tempoAccum>=virtualTempoD) {
|
while (tempoAccum>=virtualTempoD) {
|
||||||
|
|
@ -1626,15 +1639,9 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
|
||||||
// under no circumstances shall the accumulator become this large
|
// under no circumstances shall the accumulator become this large
|
||||||
if (tempoAccum>1023) tempoAccum=1023;
|
if (tempoAccum>1023) tempoAccum=1023;
|
||||||
}
|
}
|
||||||
|
|
||||||
// process stuff
|
// process stuff
|
||||||
if (!shallStop) for (int i=0; i<chans; i++) {
|
if (!shallStop) for (int i=0; i<chans; i++) {
|
||||||
// delay effects
|
|
||||||
if (chan[i].rowDelay>0) {
|
|
||||||
if (--chan[i].rowDelay==0) {
|
|
||||||
processRow(i,true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// retrigger
|
// retrigger
|
||||||
if (chan[i].retrigSpeed) {
|
if (chan[i].retrigSpeed) {
|
||||||
if (--chan[i].retrigTick<0) {
|
if (--chan[i].retrigTick<0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue