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
space around bars #767
Comments
The ones where the The last example should be accomplishable in the following manner:
|
To me, it looks as if the |
Indeed, it's quite complex, the few notes I have (in my head) are:
that's about it... the algorithm itself is not complex, but the implementation won't be simple I'm afraid... |
This might run into problems if Actually, I think what you list for the third option would actually cover all three conditions, so long as an empty bar or text is understood to be perfectly aligned with the non-empty element. I would implement this as an option, as there may be some people who want the old behavior. |
The third case would indeed more or less cover it all, maybe it would be a good start, and adjustments could be made later if necessary. I'm not totally sure about the option, the code is already quite complex, this new feature will make it at least twice more complex, not having an option could make things a little bit simpler. Also, when the bar is the last thing of a line, of course it doesn't make sense to "center" the bar or the text between previous and next syllable, so this case should be handled differently (in a |
Would you like to give it a try? I'm currently stuck on stem length... |
I'll give it a shot. |
See https://github.com/rpspringuel/gregorio/tree/feature/bar_spacing I started by simply adding the necessary infrastructure to make the new spacing optional as that's the easiest change. I've started thinking about how to implement the new spacing algorithm, but don't have anything workable yet. Looking at the time, I realize that I have to spend the rest of today doing my homework, even if tomorrow is likely to be a snow day due to the sheer amount of snow we got in the DC area yesterday (somewhere between 18 and 24 inches, depending on who you believe). I'll try knocking up a first pass at the actual spacing algorithm tomorrow, especially if it does turn out to be a snow day. |
Ok good! Take your time, that's quite a difficult task I think... |
Please look at 3810a44 and gregorio/gregorio-test@be8a060. The first is my first pass at implementation, but as you can tell from the second it's not completely successful (especially when the text needs to come before the bar). I have to stop working for today, and so can't continue to try and diagnose the problem, but I could use another set of eyes to review the code and spot any obvious mistakes. |
I think the correct link is rpspringuel/gregorio-test@be8a060 ? This really looks promising! Tere are still many things to tune, but I think you're on really good tracks here! Another use case that would be very important to improve (I would almost say "fix" as current output is quite bad): g(g) (::) 5. Start(g) I think it's the best way the pattern found in some pieces. This way the I'll review it more carefully when the clivis stem length will be done (today I hope)! |
Yes, that is the correct link. |
It looks to me like the old system already did what that image shows. Are you sure you've got the right image? |
Sorry, that's possible, I admit i didn't test, i just wanted to make sure it was possible in the new system if it wasn't in the old one, but if it already was that's good! Sorry for the noise! I should have time tomorrow to review what you did. |
I've tried your branch, but I see a few problems:
In the following example:
used in
I get the following in the develop branch: and the following in your branch (adding the new spacings too): as you can see, in the fist syllable, there is not space between
Anyway, thanks a lot for your work! It would be very helpful to get a beta2 when #803 will be merged, I was thinking to merge this too and let the old spacings by default for now, asking testers to test the new ones, what do you think? Of course, this supposes that point |
I just pushed a new commit which should fix the changes to the old spacing. I don't have time to test right now, but I thought I'd make it available. |
Seems to solve the issue with old spacings indeed, thanks a lot! I think we can merge your branch into develop before releasing beta2 then, even if you're not completely done with all the details. |
I have one idea I want to play with before submitting a PR, but I should be able to have something for tomorrow. ✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
|
I've posted what I wanted to try and am more satisfied with it than what I was getting before, though there is still some problem with the positive previousenddifference and positive nextbegindifference case. Even if I can't figure out the problem, I'll write up the documentation that goes with the changes and submit a PR tomorrow. |
I was testing this (
|
An additional change to make on the C side: syllables without notes should be considered as BarSyllables, see this thread. I think this is a relatively small change... @henryso do you think you could do it? You're the one who knows the C code best |
@rpspringuel, apart from the small bugs that should be fixed in rc1, I only got positive feedback on the new algorithm, so I think it should be the default one in rc1. Thanks a lot, you did a great job! |
I've been studying the C code to see if I could figure out how to make the change myself, and I've come to the conclusion that there are two possible strategies:
With a few pointers I might be willing to give one of these strategies a go, but I can't promise that I'll be able to get any results, C is not my strong suit. Likewise it may be that neither of these strategies is the way to go, so feel free to tell me that and I'll leave this to someone with more expertise. |
Off the cuff, I would change:
to
However, I have not looked into it deeply to see if this will break something else or not. |
@rpspringuel Let me know if you are working on the C part for this so that I don't step on your toes. |
I'm testing your off-the-cuff change, but a thought has occurred to me with this. Not only do we have to change whether That's going to get much harder and while I could probably eventually figure it out, I'm not going to be able to get it ready in time for tomorrow (the day we want to release rc1). It's probably better if someone with more knowledge of the C makes this change if it's going to happen quickly. |
The function you want to look at for that is gregoriotex_syllable_first_type. At the
|
There are many open issues (though most of them are small), I think it's best is to make sure everything is ok for rc1, we can delay it of a day or two if necessary |
@henryso: Thanks. I'll try that. |
Testing is looking good so far, but I've noticed that the change in syllable type breaks scores which use the old spacing system if they had one of these syllables with no notes. Is that going to be a problem for anyone? |
I don't know if people will have an issue with this sort of thing, but if we think it might, then perhaps we should add a new type of syllable (like |
gregorio-project/gregorio-test@16c162e shows the 4 tests which are affected by this change in behavior. If people think it will be a problem, I can easily implement a solution like @henryso suggests. |
Shoot. I forgot about the look-ahead argument again. That will create a problem with @henryso's solution. |
For now, let's just turn the new algorithm by default and make all no-notes syllables |
This may only apply to my branch, but I want to note that when a bar syllable with a translation text assigned to it occurs at the end of a line and is followed by a line which does not have any translation text, then the lyric text for the bar syllable is not raised up above the translation text (note, I've tried varying these conditions and this is the only circumstance I can find where this bug occurs). This bug can be seen in the results of the bar-spacing-new test in db97a16. My suspicion is that |
Thanks, can you provide an example? (and open a separate issue) |
The space around bars in Gregorio are really too wide, but the algorithm should also be improved, and be like the one with normal syllables (only much more complex).
Also, I believe there is a bug somewhere because the space on the left of bars with text is really wider than the space on the right, so there might be two spaces, or a missing
%
somewhere...The text was updated successfully, but these errors were encountered: