Closed craigsapp closed 3 years ago
Make them short ;-)
Here is another case:
http://verovio.humdrum.org/?file=chopin/mazurkas/mazurka17-4.krn&filter=metlev%20-caemxhm
Using the <verse>
system, the overlap is resolved:
http://verovio.humdrum.org/?file=chopin/mazurkas/mazurka17-4.krn&filter=metlev%20-caetext
But the problem is that I cannot attach lyrics to rests or to time offsets from a note attack:
It would be nice if the <harm>
and <verse>
systems had similar capabilities: both collision avoidance (currently only in <verse>
and attachable to rest or arbitrary @tstamp
locations (currently on in <harm>
.
As the overlap increases, the veritcal offset increases:
So I suspect that there is a bug: overlap avoidance is being done, but it is applied to vertical offset rather than horizontal offset.
There is a flaw in the algorithm. What is happening is that all the harm indications are aligned vertically (which means here pilled up in order to avoid collisions). Then they are all aligned with the highest one, which produces this. They should obviously be spaced before all this happening.
There is a flaw in the algorithm. What is happening is that all the harm indications are aligned vertically (which means here pilled up in order to avoid collisions). Then they are all aligned with the highest one, which produces this. They should obviously be spaced before all this happening.
Could you maybe tell me where this happens in the code, please? I have the same problem right now and would take a look at it, but can't seem to find the right position...
Responsible for the gaps are these lines of code, especially line 363 in this case: https://github.com/rism-ch/verovio/blob/13c67749cd8ee9b452ad67c18a649f7b8b9cd811/src/floatingobject.cpp#L355-L364
The information in that part are used here, probably directly after line 1581: https://github.com/rism-ch/verovio/blob/13c67749cd8ee9b452ad67c18a649f7b8b9cd811/src/view_control.cpp#L1545-L1604
I am still not able to find a solution. Any help would be highly appreciated.
What needs to be added is a pass in the layout algorithm that spaces the harm
before doing the vertical adjustment. This is missing, so it it not quite a matter of fixing existing code. (The additional problem is that adding this with the current justification algorithm will not work properly, so improving the justification algorithm should be done first. This is a quite significant task.) I will try to scaffold something.
What needs to be added is a pass in the layout algorithm that spaces the
harm
before doing the vertical adjustment. This is missing, so it it not quite a matter of fixing existing code. (The additional problem is that adding this with the current justification algorithm will not work properly, so improving the justification algorithm should be done first. This is a quite significant task.) I will try to scaffold something.
Thank you so much, Laurent! If I can help in any way, please let me know.
I really don't want to rush and I know that you certainly have a lot else on your plate. But do you think it's possible to look at this problem by the end of the month? I have the release date for an app breathing down my neck, and until recently I wasn't aware that solving the bug would require such profound changes that I unfortunately don't know the framework well enough for.
It would be great if you could just realistically estimate if the necessary changes are feasible in the next 2 weeks and if I can help somehow? Sorry if I lean too far out of the window. As I said, I don't want to pass on my own time pressure, but at the moment I'm a bit lost... 😟
EDIT: I just realized that--at least when using MusicXML--all harm texts are left-justified, so maybe there is no need to touch the justification algorithm in this case? Also the staffs below the overlapping harms are pushed further down, leaving space for multiple lines of harm text. So a quick solution might be to simply put the overlapping harms in the second (or even third?) line?
I am afraid it will not be feasible for me to free some time for this in the next two weeks.
Now following up on your last edit: you should be able to manage multiple lines of harm text using @n
, and they should be handled properly. Have you tried this?
Could you send a sample MEI file? I can have a look this afternoon if there is at all a not too complicated fix for this.
Could you send a sample MEI file? I can have a look this afternoon if there is at all a not too complicated fix for this.
Here is a MusicXML file and the MEI conversion done by Verovio: example.zip
Thank you for taking the time.
OK, I implemented something 73fa29830199337ecc1e13ee0282eed19e67d3e6 As I said, because of some limitations in the justification algorithm this can still fail in some cases. Have a try and keep me posted.
You can use the --spacing-non-linear
and/or --spacing-linear
parameters to stretch the music spacing so that the longest <chord>
does not collide with the next <chord>
:
The command-line options to generate the above rendering:
verovio --no-header --spacing-non-linear 0.65 example.musicxml
In Javascript toolkit, the options are named spacingNonLinear
and spacingLinear
.
spacingLinear parameter range: default: 0.25; min: 0.00; max: 1.00.
spacingNonLinear parameter range: default: 0.60; min: 0.00; max: 1.00
@lpugin Thank you so much! It works like a charm in most cases.
@craigsapp I already increased the spacing between notes but I needed a generic solution for several hundred songs in an iPhone App. The limited screen space makes your solution not viable, unfortunately. But thank you very much anyways!
Great! What is the App? Looking forward to testing it.
Great! What is the App? Looking forward to testing it.
It's not released yet (2 more weeks 😉 ) but the name is "Cantico".
What is the status of the following?
Yes, what is the status of this? Has there been a regression? This example on verovio's site appears to be the same music as @lpugin posted here on March 20, 2019, but the overlap is not being prevented, and the extra vertical space is present.
I did a bit of digging, and 3dd860ad5 appears to have broken this, apparently because this->HasContentBB()
is always returning false.
Thanks for looking at this. Unfortunately, I do not understand what regression you are talking about. Can you be more explicit about it?
(As explained in this thread, spacing of harm indications is not expected to work because it has never been properly implemented.)
@lpugin What I meant is that before 3dd860a, running verovio
on harm-004.mei produces output like in your comment above, but that commit introduced a change that causes verovio
to produce output like what is shown on the Test Suite page
You are right, it used to work better
I'll have a look
We are now back to previous behaviour
As
<harm>
text length is increased, the<harm>
text line rises for some reason. This rise eventually pushes the systems further apart as well. The example output on the left has short<harm>
text, while the one on the right has long<harm>
text.Short harm example data:
Long harm MEI