rism-digital / verovio

🎵 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)
https://www.verovio.org
GNU Lesser General Public License v3.0
689 stars 186 forks source link

Support for vertical and horizontal offsets on fingering and potentially other elements #3461

Open infojunkie opened 1 year ago

infojunkie commented 1 year ago

Describe the problem Fingering indication does not respond to relative positioning @ho / @vo.

To Reproduce Steps to reproduce the behavior:

  1. Load the data attached into Verovio MEI Viewer
  2. Observe that the fingering above the first E note is not moved from its default position, even though the corresponding fing element includes @ho and @vo attributes.

Expected behavior The fingering indication would be moved according to these attributes, as per the specification.

Input data Attached.

Verovio information

rettinghaus commented 1 year ago

Offset attributes are currently not supported.

lpugin commented 1 year ago

Yes, @rettinghaus is right. This is a general feature request. I've been thinking about it for a while. (See this discussion. It seems that the common understanding for offsets if for them to be applied after the layout algorithm has been performed. This can potentially yield collision, since that might precisely be the desired goal.

I am working on a project where offsets will be useful, so I will add them in the couple of months. I am renaming the issue accordingly.

craigsapp commented 1 year ago

Fingering indication does not respond to relative positioning @ho / @vo.

@ho can often better be described with @tstamp (and for elements with an endpoint @tstamp2, rather than using @startid/@endid. Once @ho is implemented there can be semantic problems when dealing with dynamic score layout if you are not careful.

@vo is more generally useful to have, although there are many verovio options that can be used to accomplish the same thing.

Both would be necessary to refine notation so that musicians reading from a verovio typeset score from complaining. (But this would typically be to optimize a static layout of the music.)

Here is an example:

Screenshot 2023-06-25 at 6 13 58 PM
Click to view MEI data for above example. ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-06-25T18:14:00" version="3.16.0-dev-bac8070"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title xml:id="title-L1" analog="humdrum:Xfi" type="translated">extract -s 0,1,2 reference Xfilter extract -s 0,1,2
1 2 3 1 2 1 2 3 1 2
```

The placement of the red fingering could be improved. The first measure uses @tstamp="3.5" while the second one uses @tstamp="3.75". Preferably the 3.5 timestamp should look like the 3.75 example (or even more preferably, 3.5 should generate a horizontal position exactly in the middle between the two adjacent fingerings.

You can post an example of what you want. Probably you are thinking of something different: you want to attach the fingerings to a specific @startid and offset from the verovio automatic placement:

Screenshot 2023-06-25 at 6 45 18 PM

In which case @ho and @vo would be required.

infojunkie commented 1 year ago

Thanks for the detailed response. Yes, I am trying to emulate (and improve upon) a Finale rendering that looks like this:

finale.

I'd like to avoid mixing timing information with layouting information if at all possible. I guess I could also target the relevant svg elements and explicitly move them after rendering, but too many of these hacks will get messy.

craigsapp commented 1 year ago

In your particular case @ho and @vo are the best to use, and not @tstamp (for @ho). When the layout changes, you do not want the spacing between the notes and fingerings to change for various horizontal layout spacings. For @tstamp the spacing will change.

lpugin commented 1 year ago

@craigsapp there is also @to (see https://music-encoding.org/guidelines/dev/attribute-classes/att.visualOffset.to.html), which I think would be quite interesting to support for dynamic rendering. However, the common understanding for that one might be more to be a pre-layout calculation offset, though, and a clarification on this might be necessary.