mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-18 02:25:11 +00:00
ZSM export: handle Virtual Tempo quantization
This commit is contained in:
parent
b41d8fe208
commit
7aa3aec20e
1 changed files with 12 additions and 3 deletions
|
@ -94,6 +94,7 @@ SafeWriter* DivEngine::saveZSM(unsigned int zsmrate, bool loop) {
|
||||||
playSub(false);
|
playSub(false);
|
||||||
//size_t tickCount=0;
|
//size_t tickCount=0;
|
||||||
bool done=false;
|
bool done=false;
|
||||||
|
bool loopNow=false;
|
||||||
int loopPos=-1;
|
int loopPos=-1;
|
||||||
int fracWait=0; // accumulates fractional ticks
|
int fracWait=0; // accumulates fractional ticks
|
||||||
if (VERA>=0) disCont[VERA].dispatch->toggleRegisterDump(true);
|
if (VERA>=0) disCont[VERA].dispatch->toggleRegisterDump(true);
|
||||||
|
@ -109,9 +110,17 @@ SafeWriter* DivEngine::saveZSM(unsigned int zsmrate, bool loop) {
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
if (loopPos==-1) {
|
if (loopPos==-1) {
|
||||||
if (loopOrder==curOrder && loopRow==curRow && ticks==1 && loop) {
|
if (loopOrder==curOrder && loopRow==curRow && loop)
|
||||||
|
loopNow=true;
|
||||||
|
if (loopNow) {
|
||||||
|
// If Virtual Tempo is in use, our exact loop point
|
||||||
|
// might be skipped to quantization error.
|
||||||
|
// If this happens, the tick immediately following is our loop point.
|
||||||
|
if (ticks==1 || !(loopOrder==curOrder && loopRow==curRow)) {
|
||||||
loopPos=zsm.getoffset();
|
loopPos=zsm.getoffset();
|
||||||
zsm.setLoopPoint();
|
zsm.setLoopPoint();
|
||||||
|
loopNow=false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nextTick() || !playing) {
|
if (nextTick() || !playing) {
|
||||||
|
|
Loading…
Reference in a new issue