From 475dda2575b76eb53736001a396387f5e07df88d Mon Sep 17 00:00:00 2001 From: William Toohey Date: Tue, 5 Jan 2016 22:10:59 +1000 Subject: [PATCH] Fix buildups being off by 1 --- js/HuesCore.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/HuesCore.js b/js/HuesCore.js index 86f3999..8416d8a 100644 --- a/js/HuesCore.js +++ b/js/HuesCore.js @@ -356,7 +356,10 @@ HuesCore.prototype.setSong = function(index) { HuesCore.prototype.fillBuildup = function() { this.beatLength = this.soundManager.loopLength / this.currentSong.rhythm.length; - var buildBeats = Math.floor(this.soundManager.loopStart / this.beatLength) + 1; + var buildBeats = Math.floor(this.soundManager.loopStart / this.beatLength); + if(buildBeats < 1) { + buildBeats = 1; + } if (this.currentSong.buildupRhythm === null) { this.currentSong.buildupRhythm = ""; }