humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
37 stars 9 forks source link

Problem with mRest in mensuralish notation #536

Closed craigsapp closed 3 years ago

craigsapp commented 3 years ago

In this example: https://verovio.humdrum.org/?file=jrp:Jos2707

There is a problem that seems to be related to the whole-measure breve rest (when using <mRest>), where the rest is treated as if it were a maxima, since verovio does not know the duration of the measure.

Short example with the problem:

**kern  **kern
*clefC3 *clefC3
*M2/1   *M2/1
*met(C|)    *met(C|)
=1  =1
1C  0r
1D  .
=   =
0D  0A
=   =
*-  *-
!!!system-decoration: [*]

Rendering in verovio (where extra space beyond what is expected is added to the first measure):

Screen Shot 2021-01-23 at 12 33 09 PM

MEI conversion:

<?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:33:50" 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-0000002101758005">
    <score xml:id="score-0000001438538395">
     <scoreDef xml:id="scoredef-0000001912549617" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000001488147047" symbol="bracket">
       <staffDef xml:id="staffdef-0000000578850738" n="1" lines="5">
        <clef xml:id="clef-L2F2" shape="C" line="3" />
        <meterSig xml:id="metersig-L3F2" unit="1" />
        <mensur xml:id="mensur-L4F2" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" />
       </staffDef>
       <staffDef xml:id="staffdef-0000000921753726" n="2" lines="5">
        <clef xml:id="clef-L2F1" shape="C" line="3" />
        <meterSig xml:id="metersig-L3F1" 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-0000001612777103" n="1">
        <layer xml:id="layer-L1F2N1" n="1">
         <mRest xml:id="mrest-L6F2" />
        </layer>
       </staff>
       <staff xml:id="staff-0000002095492584" 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>

The element causing the problem:

<mRest xml:id="mrest-L6F2" />

So the <mRest> does not know that the duration of a measure is, and it is choosing too long of a duration as a result.

Here is an example where the mensuration sign is replaced with a time signature:

**kern  **kern
*clefC3 *clefC3
*M2/1   *M2/1
=1  =1
1C  0r
1D  .
=   =
0D  0A
=   =
*-  *-
!!!system-decoration: [*]

This is rendered correctly:

Screen Shot 2021-01-23 at 12 37 35 PM

and is performed correctly.

MEI conversion:

<?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:39:38" 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="10" token="!!!system-decoration: [*]" xml:id="L11">
     <frameInfo>
      <startTime float="16" />
      <frameType>reference</frameType>
      <referenceKey>system-decoration</referenceKey>
      <referenceValue>[*]</referenceValue>
     </frameInfo>
    </metaFrame>
   </frames>
  </extMeta>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001797605856">
    <score xml:id="score-0000000931836598">
     <scoreDef xml:id="scoredef-0000000292109205" midi.bpm="400">
      <staffGrp xml:id="staffgrp-0000000896629008" symbol="bracket">
       <staffDef xml:id="staffdef-0000000822341907" n="1" lines="5">
        <clef xml:id="clef-L2F2" shape="C" line="3" />
        <meterSig xml:id="metersig-L3F2" count="2" unit="1" />
       </staffDef>
       <staffDef xml:id="staffdef-0000002095151178" n="2" lines="5">
        <clef xml:id="clef-L2F1" shape="C" line="3" />
        <meterSig xml:id="metersig-L3F1" count="2" unit="1" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="1">
       <staff xml:id="staff-0000001751273383" n="1">
        <layer xml:id="layer-L1F2N1" n="1">
         <mRest xml:id="mrest-L5F2" />
        </layer>
       </staff>
       <staff xml:id="staff-0000000005482620" n="2">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L5F1" dur="1" oct="3" pname="c" accid.ges="n" />
         <note xml:id="note-L6F1" dur="1" oct="3" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L7">
       <staff xml:id="staff-L7F2N1" n="1">
        <layer xml:id="layer-L7F2N1" n="1">
         <note xml:id="note-L8F2" dur="breve" oct="3" pname="a" accid.ges="n" />
        </layer>
       </staff>
       <staff xml:id="staff-L7F1N1" n="2">
        <layer xml:id="layer-L7F1N1" n="1">
         <note xml:id="note-L8F1" dur="breve" oct="3" pname="d" accid.ges="n" />
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

The solution will be to add meterSig@count:

<meterSig xml:id="metersig-L3F2" count="2" unit="1" />

This was originally removed because verovio would display the time signature and the mensuration sign at the same time.

Here is the target rendering of the first example with meterSig@count added:

<?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" 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" 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>

MIDI playback and notation will be rendered correctly:

Screen Shot 2021-01-23 at 12 49 07 PM

but verovio needs to suppress the time signature if there is a mensuration sign at the same time.

craigsapp commented 3 years ago

The solution provided by @rettinghaus in issue https://github.com/rism-ch/verovio/issues/1988 is to use meterSig@form="invis"

Example:

Screen Shot 2021-01-23 at 3 08 58 PM

Target conversion to MEI:

<?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>
craigsapp commented 3 years ago

Fixed with commit https://github.com/rism-ch/verovio/commit/2bb79bee986b5de268ab21f7bc6335b7506731a4