ParseSong: Separate events from notes

This commit is contained in:
LoveEevee
2020-03-15 18:00:23 +03:00
parent 0a578578c5
commit 38f1384f27
5 changed files with 46 additions and 33 deletions

View File

@@ -43,6 +43,7 @@
this.metadata = this.parseMetadata()
this.measures = []
this.beatInfo = {}
this.events = []
if(!metaOnly){
this.circles = this.parseCircles()
}
@@ -248,7 +249,12 @@
lastDrumroll = circleObj
}
circles.push(circleObj)
if(note.event){
this.events.push(circleObj)
}
if(note.type !== "event"){
circles.push(circleObj)
}
} else if (!(currentMeasure.length >= 24 && (!currentMeasure[i + 1] || currentMeasure[i + 1].type))
&& !(currentMeasure.length >= 48 && (!currentMeasure[i + 2] || currentMeasure[i + 2].type || !currentMeasure[i + 3] || currentMeasure[i + 3].type))) {
if (note_chain.length > 1 && currentMeasure.length >= 8) {
@@ -266,9 +272,12 @@
}
}
var insertNote = circleObj => {
lastBpm = bpm
lastGogo = gogo
if(circleObj){
if(bpm !== lastBpm || gogo !== lastGogo){
circleObj.event = true
lastBpm = bpm
lastGogo = gogo
}
currentMeasure.push(circleObj)
}
}