Fix odd numbered inverts when buildups are off

master
William Toohey 10 years ago
parent 475dda2575
commit dcfdb0814d
  1. 11
      js/HuesCore.js

@ -370,7 +370,16 @@ HuesCore.prototype.fillBuildup = function() {
}
}
console.log("Buildup length:", buildBeats);
this.beatIndex = this.doBuildup ? -this.currentSong.buildupRhythm.length : 0;
if(this.doBuildup) {
this.beatIndex = -this.currentSong.buildupRhythm.length;
} else {
this.beatIndex = 0;
// If there's an odd amount of inverts in the build, invert our display
var invertCount = (this.currentSong.buildupRhythm.match(/i|I/g)||[]).length
if(invertCount % 2) {
this.setInvert(true);
}
}
};
HuesCore.prototype.randomSong = function() {

Loading…
Cancel
Save