Fix empty measures being ignored

This commit is contained in:
LoveEevee 2018-10-11 02:41:02 +03:00
parent 39655fc534
commit 4b986c62ec

View File

@ -123,6 +123,29 @@
var circleID = 0
var pushMeasure = () => {
if(barLine){
var note = currentMeasure[0]
if(note){
var speed = note.bpm * note.scroll / 60
}else{
var speed = bpm * scroll / 60
}
this.measures.push({
ms: ms,
speed: speed
})
if(firstMeasure){
firstMeasure = false
var msPerMeasure = 60000 * measure / bpm
for(var measureMs = ms - msPerMeasure; measureMs > 0; measureMs -= msPerMeasure){
this.measures.push({
ms: measureMs,
speed: speed
})
}
}
}
if(currentMeasure.length){
for(var i = 0; i < currentMeasure.length; i++){
var note = currentMeasure[i]
if(firstNote && note.type){
@ -160,27 +183,9 @@
circles.push(circleObj)
}
}
if(barLine){
var note = currentMeasure[0]
if(note){
var speed = note.bpm * note.scroll / 60
}else{
var speed = bpm * scroll / 60
}
this.measures.push({
ms: ms,
speed: speed
})
if(firstMeasure){
firstMeasure = false
var msPerMeasure = 60000 * measure / bpm
for(var measureMs = ms - msPerMeasure; measureMs > 0; measureMs -= msPerMeasure){
this.measures.push({
ms: measureMs,
speed: speed
})
}
}
ms += msPerMeasure
}
}
@ -231,6 +236,9 @@
case "delay":
ms += (parseFloat(value) || 0) * 1000
break
case "barlineon":
barLine = true
break
case "barlineoff":
barLine = false
break