JosephEoff / MuseScore_UltraStar_Exporter

MuseScore plugin to create UltraStar files
GNU General Public License v2.0
0 stars 3 forks source link

Handle mid-song BPM changes #13

Closed jeetee closed 8 years ago

jeetee commented 8 years ago

UltraStar format allows for mid-song BPM changes by having a line formatted as follows:

B tick bpm

Performous parser section

jeetee commented 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?

JosephEoff commented 8 years ago

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.

JosephEoff commented 8 years ago

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.