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

Mensural signs in CMN #1988

Closed craigsapp closed 3 years ago

craigsapp commented 3 years ago

When using mensural signs in CMN, there is a problem with resolving the duration of <mRest>. This can be solved in several ways that are listed below (ideally all of them would be implemented, but at least one will be sufficient -- or any current solution that I have not thought of):

(1) Implicitly hidden time signatures: If both a time signature and a mensuration sign occur at the same time in the score, the time signature should not be displayed. This is important, because mensuration signs can have number qualifiers, so including a time signature causes a lot of confusion. Including <meterSig> would allow the duration of <mRest> to be calculated properly. I currently do a variation of this to allow correct @tstamp units, where I give meterSig@unit, but do not give meterSig@count to prevent the time signature from being displayed.

(2) Explicitly hidden time signatures: MEI could add an attribute meterSig@visible="false" to explicitly hide the time signature. This solution would also be useful for extracting music from a longer score, where the time signature should not be displayed but @tstamp and mRest/multiRest will not break. (Or you can remind me of an equivalent method that is currently possible).

(3) Explicit durations for mRests: verovio could implement mRest@dur and related attributes (particularly @dur.ges) that override the automatic assignment of the measure duration from the meterSig. (I have tried this solution and at least it seems that verovio is currently ignoring the duration attributes on mRest.

Related to issue https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/536

rettinghaus commented 3 years ago

Please add a visual example. And I think it's <meterSig form="invis"/>.

craigsapp commented 3 years ago

<meterSig form="invis"/>

Thanks! That works.

Please add a visual example.

That was the purpose of the link at the end of the post 😛

Here is an example of the solution, which renders and plays via MIDI correctly now in verovio:

Screen Shot 2021-01-23 at 3 08 58 PM
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2021-01-23T12:44:09" version="3.2.0-dev-e1219ba-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
  <extMeta>
   <frames xmlns="http://www.humdrum.org/ns/humxml">
    <metaFrame n="11" token="!!!system-decoration: [*]" xml:id="L12">
     <frameInfo>
      <startTime float="16" />
      <frameType>reference</frameType>
      <referenceKey>system-decoration</referenceKey>
      <referenceValue>[*]</referenceValue>
     </frameInfo>
    </metaFrame>
   </frames>
  </extMeta>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000000613296468">
    <score xml:id="score-0000001081178591">
     <scoreDef xml:id="scoredef-0000001912549617" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000000565269156" symbol="bracket">
       <staffDef xml:id="staffdef-0000000509008038" n="1" lines="5">
        <clef xml:id="clef-L2F2" shape="C" line="3" />
        <meterSig xml:id="metersig-L3F2" form="invis" count="2" unit="1" />
        <mensur xml:id="mensur-L4F2" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" />
       </staffDef>
       <staffDef xml:id="staffdef-0000000487888376" n="2" lines="5">
        <clef xml:id="clef-L2F1" shape="C" line="3" />
        <meterSig xml:id="metersig-L3F1" form="invis" count="2" unit="1" />
        <mensur xml:id="mensur-L4F1" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-0000001226078887" n="1">
        <layer xml:id="layer-L1F2N1" n="1">
         <mRest xml:id="mrest-L6F2" />
        </layer>
       </staff>
       <staff xml:id="staff-0000001419325351" n="2">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="1" oct="3" pname="c" accid.ges="n" />
         <note xml:id="note-L7F1" dur="1" oct="3" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L8">
       <staff xml:id="staff-L8F2N1" n="1">
        <layer xml:id="layer-L8F2N1" n="1">
         <note xml:id="note-L9F2" dur="breve" oct="3" pname="a" accid.ges="n" />
        </layer>
       </staff>
       <staff xml:id="staff-L8F1N1" n="2">
        <layer xml:id="layer-L8F1N1" n="1">
         <note xml:id="note-L9F1" dur="breve" oct="3" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>