Closed jeetee closed 8 years ago
I think this can be easily added, as it's simply checking for another annotation.
I'm also thinking about reworking the checkForMarker function and incorporating BPM checks in there. Currently we already loop through all annotations three times for each note (checkForMarker), with BPM support this would become 4 times.
The new approach would be a function that checks the annotations and returns a simple object along this format:
{
tempo: null | value
golden: true | false
freestyle: true | false
lineBreak: true | false
}
Any thoughts on your end about that approach?
I didn't know about the BPM changes - the documentation I used didn't mention it. I'll have a look-see at checkForMarker later, but I think it would be better to separate the marker check and the BPM check.
Definitely separate methods.
It doesn't matter that we're checking the annotations multiple times - there's almost never a StaffText, and when there is there's usually only one.
We'll leave checkForMarkerInStaffText as is and create two new methods:
hasBPMChange (segment)
getNewBPMFromSegment(segment)
hasBPMChange checks for a Element.TEMPO_TEXT in the annotations and returns true if there is one.
getNewBPMFromSegment gets the new tempo.
UltraStar format allows for mid-song BPM changes by having a line formatted as follows:
Performous parser section