Skip to content

Commit

Permalink
Make sure that loop flag gets set on tempo-synced periodic modulator
Browse files Browse the repository at this point in the history
  • Loading branch information
mcslee committed May 9, 2022
1 parent 0690340 commit c10fba3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/heronarts/lx/modulator/LXPeriodicModulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,15 @@ protected final double computeValue(double deltaMs) {
this.basis = rawBasis % 1.;
if (this.restarted) {
this.restarted = false;
} else if ((measure != this.lastMeasure) && !this.looping.isOn()) {
this.basis = 1;
this.finished = true;
this.stop();
} else if (measure != this.lastMeasure) {
if (this.looping.isOn()) {
this.looped = true;
this.numLoops = (measure > this.lastMeasure) ? (measure - this.lastMeasure) : 1;
} else {
this.basis = 1;
this.finished = true;
this.stop();
}
}
this.lastMeasure = measure;
} else {
Expand Down

0 comments on commit c10fba3

Please sign in to comment.