-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linebreak algorithm #27
Comments
This can probably be implemented the easiest in the MutableVoice.AddSentence function, by changing the |
linebreak timings are there for a reason. Sometimes you want a linebreak to happen very late, so the next line is a bit more of a surprise and other times - especially in more fast paced songs, you'll want the line breaks to happen earlier, so one still has enough time to read ahead. |
fyi, if you press t in the USDX editor and then press s to save, it will adjust all linebreaks to be two third between the first and last notes, if possible. |
didn't know about the 't' in the editor, but after playing around with it for a bit, I find that setting them myself works just fine. |
In #26 I noted that the specific beats at which line breaks occured are (at the time of writing) ignored by the parser. Currently, the song format files have line breaks at specific beats, but other than saving some computation work, is it really that useful? It's probably not hard to add a little algorithm that, given two sentences A and B, computes the optimal line break beat.
Here's some pseudo algorithm, I've explicitly used the notes for start/endbeat here, there's a convenience method on the Sentence object as well which will do just that (the important thing to remember is that a Sentence doesn't have any "padding"):
If (A.lastnote.endbeat >= B.firstnote.startbeat) return A.lastnote.endbeat
(we can't really do anything useful in this situation)
Essentially, this will cause two equidistant sentences to always have the same (relative) linebreak beat.
The text was updated successfully, but these errors were encountered: