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
687 stars 185 forks source link

Missing cases for octave-transposition clefs #3181

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

15ma-down-treble clefs are being displayed instead as 8va-down-treble clefs:

Screen Shot 2022-12-23 at 3 35 17 PM

The top staff should have a 15 above the treble clef rather than an 8.

Click to view MEI data for above example ```xml Check octave displacements for treble clef Verovio

Transcoded from Humdrum

Check octave displacements for treble clef reference OPR Clef reference ONM 6 reference OTL Check octave displacements for treble clef reference title @{OPR} @{ONM}: @{OTL}
Check octave displacements for treble clef    
display two octaves lower display two octaves higher display one octave lower display one octave higher normal treble clef
```

StaffDefs from MEI data (first one is correct, but clef@dis="15" is displaying as8`):

<staffDef xml:id="staffdef-L4F5" n="1" lines="5">
   <clef xml:id="clef-L5F5" shape="G" line="2" dis="15" dis.place="above" />
   <meterSig xml:id="metersig-L6F5" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F4" n="2" lines="5">
   <clef xml:id="clef-L5F4" shape="G" line="2" dis="15" dis.place="below" />
   <meterSig xml:id="metersig-L6F4" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F3" n="3" lines="5">
   <clef xml:id="clef-L5F3" shape="G" line="2" dis="8" dis.place="above" />
   <meterSig xml:id="metersig-L6F3" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F2" n="4" lines="5">
   <clef xml:id="clef-L5F2" shape="G" line="2" dis="8" dis.place="below" />
   <meterSig xml:id="metersig-L6F2" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F1" n="5" lines="5">
   <clef xml:id="clef-L5F1" shape="G" line="2" />
   <meterSig xml:id="metersig-L6F1" count="4" unit="4" />
</staffDef>
craigsapp commented 1 year ago

For the alto clef, both two octaves up/down transpositions are not displaying the number 15 above/below the clef, and there is also a problem with 8 above the staff case line the third staff, where it is instead being displayed below the staff.

Screen Shot 2022-12-23 at 3 34 51 PM
Click to view MEI data for above example. ```xml Check octave displacements for alto clef Verovio

Transcoded from Humdrum

Check octave displacements for alto clef reference OPR Clef reference ONM 8 reference OTL Check octave displacements for alto clef reference title @{OPR} @{ONM}: @{OTL}
Check octave displacements for alto clef    
display two octaves lower display two octaves higher display one octave lower display one octave higher normal alto clef
```

Here are the StaffDefs for the example:

<staffDef xml:id="staffdef-L4F5" n="1" lines="5">
   <clef xml:id="clef-L5F5" shape="C" line="3" dis="15" dis.place="above" />
   <meterSig xml:id="metersig-L6F5" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F4" n="2" lines="5">
   <clef xml:id="clef-L5F4" shape="C" line="3" dis="15" dis.place="below" />
   <meterSig xml:id="metersig-L6F4" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F3" n="3" lines="5">
   <clef xml:id="clef-L5F3" shape="C" line="3" dis="8" dis.place="above" />
   <meterSig xml:id="metersig-L6F3" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F2" n="4" lines="5">
   <clef xml:id="clef-L5F2" shape="C" line="3" dis="8" dis.place="below" />
   <meterSig xml:id="metersig-L6F2" count="4" unit="4" />
</staffDef>
<staffDef xml:id="staffdef-L4F1" n="5" lines="5">
   <clef xml:id="clef-L5F1" shape="C" line="3" />
   <meterSig xml:id="metersig-L6F1" count="4" unit="4" />
</staffDef>

Note that the first two have clef@diss="15" which is being ignored, and also notice that the third staff is displaying the '8' below the staff when it should instead be above the staff:

<staffDef xml:id="staffdef-L4F3" n="3" lines="5">
   <clef xml:id="clef-L5F3" shape="C" line="3" dis="8" dis.place="above" />
   <meterSig xml:id="metersig-L6F3" count="4" unit="4" />
</staffDef>
rettinghaus commented 1 year ago

The requested c clefs are not available in SMuFL.

craigsapp commented 1 year ago

For 15ma up/down C clefs which are not available in SMuFL, it would be reasonable to not display them since they are probably theoretical. But in that case the plain C clef should be displayed (as is being done) as well as a warning message about this lack of support.

For the 8va above case for the C clef. Verovio is instead showing it below. Since there is no C clef with an 8 above it in SMuFL, it would be better to not show the 8 below, and instead show a plain C clef as well as a warning for an unsupported clef. There are these two clefs in SMuFL:

http://www.smufl.org/version/latest/range/clefs

Screen Shot 2022-12-24 at 4 45 42 AM

And one of them probably means to play the notes one octave higher than written (probably the one on the left), so one idea would be to substitute that one for the missing case of a c clef with an 8 above it.

Such clefs would be very low priority, but it would be possible to make via compositing. Here are the 8 and 15 sub-glyphs for extended clef cases: http://www.smufl.org/version/latest/range/clefs

Screen Shot 2022-12-24 at 4 35 16 AM Screen Shot 2022-12-24 at 4 35 20 AM

But of course, then each font would need to be dealt with as a separate case for kerning them together (unless SMuFL has attachment points for such numbers in the font metrics). Or they could be placed properly for Leipzig font, and then use that fixed position for all other fonts. By the way, I see that Finale is now providing numerous SIL Open Font SMuFL fonts:

https://www.smufl.org/fonts https://usermanuals.finalemusic.com/FinaleWin/Content/Finale/ht-fonts.htm


For the 15ma-up treble clef, there is probably a typo in the SMuFL code, since that one does exist: http://www.smufl.org/version/latest/range/clefs

Screen Shot 2022-12-24 at 4 33 45 AM

Verovio is currently displaying that one as an "8" above the G clef rather than a 15.

craigsapp commented 1 year ago

F clef cases of 8 and 15 numbers, all display properly in verovio (since there are SMuFL versions of all of these):

Screen Shot 2022-12-24 at 5 02 08 AM
Click to view MEI data for above example. ```xml Check octave displacements for bass clef Verovio

Transcoded from Humdrum

Check octave displacements for bass clef reference OPR Clef reference ONM 7 reference OTL Check octave displacements for bass clef reference title @{OPR} @{ONM}: @{OTL}
Check octave displacements for bass clef    
display two octaves lower display two octaves higher display one octave lower display one octave higher normal bass clef
```
craigsapp commented 1 year ago

Ideally verovio should also print an error message to stderr when it is requested to render a clef that it cannot (in this case if it is not one of the pre-made SMuFL ones).

rettinghaus commented 1 year ago

@craigsapp The method is called multiple times, so issuing a warning would probably cause even more confusion.

craigsapp commented 1 year ago

OK, they are rare clefs, so user beware.