Skip to content

Commit

Permalink
Temporary fix related to issue #3515
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Sep 17, 2023
1 parent 888b565 commit 6938832
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/iohumdrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17975,7 +17975,10 @@ hum::HumNum HumdrumInput::getMeasureTstamp(hum::HTp token, int staffindex, hum::
// what is this for? Causes problems with pedal markings.
// qbeat += fract * token->getDuration().getAbs();
}
hum::HumNum mfactor = ss[staffindex].meter_bottom / 4;
// Below is temporary fix for issue https://github.com/rism-digital/verovio/issues/3515
hum::HumNum mfactor = ss.back().meter_bottom / 4;
// hum::HumNum mfactor = ss[staffindex].meter_bottom / 4;

// if (ss[staffindex].meter_bottom == 0) {
// mfactor = 1;
// mfactor /= 8;
Expand Down

3 comments on commit 6938832

@craigsapp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example:

!!!filter: meter
**kern	**kern	**kern
*M4/4	*M3/4	*M6/8
=1	=1	=1
4c	4c	8cL
.	.	8d
4d	4d	8eJ
.	.	8fL
4e	4e	8g
.	.	8aJ
=-	=2	=2
4f	4c	8cL
.	.	8d
=2	=-	=-
4c	4d	8eJ
.	.	8fL
4d	4e	8g
.	.	8aJ
=-	=3	=3
4e	4c	8cL
.	.	8d
4f	4d	8eJ
.	.	8fL
=3	=-	=-
4c	4e	8g
.	.	8aJ
=-	=4	=4
4d	4c	8cL
.	.	8d
4e	4d	8eJ
.	.	8fL
4f	4e	8g
.	.	8aJ
==	==	==
*-	*-	*-
Screenshot 2023-09-17 at 02 06 49
Click for MEI conversion of above Humdrum data
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/dev/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-09-17T02:07:18" version="3.17.0-dev-888b565-dirty">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title xml:id="title-L1" analog="humdrum:Xfi" type="translated">meter</title>
   </work>
  </workList>
  <extMeta>
   <frames xmlns="http://www.humdrum.org/ns/humxml">
    <metaFrame n="0" token="!!!Xfilter: meter " xml:id="L1">
     <frameInfo>
      <startTime float="0" />
      <frameType>reference</frameType>
      <referenceKey>Xfilter</referenceKey>
      <referenceValue>meter</referenceValue>
     </frameInfo>
    </metaFrame>
   </frames>
  </extMeta>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="m41c693">
    <score xml:id="sdwa1t5">
     <scoreDef xml:id="s15n3dxr">
      <staffGrp xml:id="su99sch" symbol="bracket">
       <staffDef xml:id="staffdef-L2F5" n="1" lines="5">
        <clef xml:id="czqpm9z" shape="G" line="2" />
        <meterSig xml:id="metersig-L3F5" count="6" unit="8" />
       </staffDef>
       <staffDef xml:id="staffdef-L2F3" n="2" lines="5">
        <clef xml:id="c56ij8h" shape="G" line="2" />
        <meterSig xml:id="metersig-L3F3" count="3" unit="4" />
       </staffDef>
       <staffDef xml:id="staffdef-L2F1" n="3" lines="5">
        <clef xml:id="c1v08l6f" shape="G" line="2" />
        <meterSig xml:id="metersig-L3F1" count="4" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L2F1">
      <measure xml:id="measure-L1" right="invis" n="1">
       <staff xml:id="staff-L2F5" n="1">
        <layer xml:id="layer-L1F5N1" n="1">
         <beam xml:id="beam-L6F5-L8F5">
          <note xml:id="note-L6F5" dur="8" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L7F5" dur="8" oct="4" pname="d" accid.ges="n" />
          <note xml:id="note-L8F5" dur="8" oct="4" pname="e" accid.ges="n" />
         </beam>
         <beam xml:id="beam-L9F5-L11F5">
          <note xml:id="note-L9F5" dur="8" oct="4" pname="f" accid.ges="n" />
          <note xml:id="note-L10F5" dur="8" oct="4" pname="g" accid.ges="n" />
          <note xml:id="note-L11F5" dur="8" oct="4" pname="a" accid.ges="n" />
         </beam>
         <barLine xml:id="barline-L12F5" form="single" />
        </layer>
       </staff>
       <staff xml:id="staff-L2F3" n="2">
        <layer xml:id="layer-L1F3N1" n="1">
         <note xml:id="note-L6F3" dur="4" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L8F3" dur="4" oct="4" pname="d" accid.ges="n" />
         <note xml:id="note-L10F3" dur="4" oct="4" pname="e" accid.ges="n" />
         <barLine xml:id="barline-L12F3" form="single" />
        </layer>
       </staff>
       <staff xml:id="staff-L2F1" n="3">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L6F1" dur="4" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L8F1" dur="4" oct="4" pname="d" accid.ges="n" />
         <note xml:id="note-L10F1" dur="4" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
       <harm xml:id="harm-L6F2" type="beat" place="below" staff="3" tstamp="1.000000" n="2">
        <rend xml:id="r1pxc33l">1</rend>
       </harm>
       <harm xml:id="h1r7il27" type="key-label" place="below" staff="3" tstamp="1.000000" n="2">
        <rend xml:id="r1trb07c" halign="right" fontstyle="italic">
         <rend xml:id="rpc5m1l">beat:</rend> </rend>
       </harm>
       <harm xml:id="harm-L6F4" type="beat" place="below" staff="2" tstamp="1.000000" n="4">
        <rend xml:id="rtgy5y">1</rend>
       </harm>
       <harm xml:id="hz50kza" type="key-label" place="below" staff="2" tstamp="1.000000" n="4">
        <rend xml:id="r1unoglj" halign="right" fontstyle="italic">
         <rend xml:id="r1n7g2y7">beat:</rend> </rend>
       </harm>
       <harm xml:id="harm-L6F6" type="beat" place="below" staff="1" tstamp="1.000000" n="6">
        <rend xml:id="r1u0pj4w">1</rend>
       </harm>
       <harm xml:id="h1exf6yj" type="key-label" place="below" staff="1" tstamp="1.000000" n="6">
        <rend xml:id="r2sb3in" halign="right" fontstyle="italic">
         <rend xml:id="rtshqvg">beat:</rend> </rend>
       </harm>
       <harm xml:id="harm-L7F6" type="beat" place="below" staff="1" tstamp="1.500000" n="6">
        <rend xml:id="rnoo4wq">1+1/3</rend>
       </harm>
       <harm xml:id="harm-L8F2" type="beat" place="below" staff="3" tstamp="2.000000" n="2">
        <rend xml:id="rbb381a">2</rend>
       </harm>
       <harm xml:id="harm-L8F4" type="beat" place="below" staff="2" tstamp="2.000000" n="4">
        <rend xml:id="rfkmwod">2</rend>
       </harm>
       <harm xml:id="harm-L8F6" type="beat" place="below" staff="1" tstamp="2.000000" n="6">
        <rend xml:id="rjtgnwl">1+2/3</rend>
       </harm>
       <harm xml:id="harm-L9F6" type="beat" place="below" staff="1" tstamp="2.500000" n="6">
        <rend xml:id="r1v23sg3">2</rend>
       </harm>
       <harm xml:id="harm-L10F2" type="beat" place="below" staff="3" tstamp="3.000000" n="2">
        <rend xml:id="r1l8ns1l">3</rend>
       </harm>
       <harm xml:id="harm-L10F4" type="beat" place="below" staff="2" tstamp="3.000000" n="4">
        <rend xml:id="r10wy0xo">3</rend>
       </harm>
       <harm xml:id="harm-L10F6" type="beat" place="below" staff="1" tstamp="3.000000" n="6">
        <rend xml:id="r1oi68r7">2+1/3</rend>
       </harm>
       <harm xml:id="harm-L11F6" type="beat" place="below" staff="1" tstamp="3.500000" n="6">
        <rend xml:id="r1mlli4r">2+2/3</rend>
       </harm>
      </measure>
      <measure xml:id="measure-L12" right="invis">
       <staff xml:id="staff-L12F5N1" n="1">
        <layer xml:id="layer-L12F5N1" n="1">
         <note xml:id="note-L13F5" dur="8" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L14F5" dur="8" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
       <staff xml:id="staff-L12F3N1" n="2">
        <layer xml:id="layer-L12F3N1" n="1">
         <note xml:id="note-L13F3" dur="4" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
       <staff xml:id="staff-L12F1N1" n="3">
        <layer xml:id="layer-L12F1N1" n="1">
         <note xml:id="note-L13F1" dur="4" oct="4" pname="f" accid.ges="n" />
         <barLine xml:id="barline-L15F1" form="single" />
        </layer>
       </staff>
       <harm xml:id="harm-L13F2" type="beat" place="below" staff="3" tstamp="1.000000" n="2">
        <rend xml:id="r1izeequ">4</rend>
       </harm>
       <harm xml:id="harm-L13F4" type="beat" place="below" staff="2" tstamp="1.000000" n="4">
        <rend xml:id="r1eqk9wx">1</rend>
       </harm>
       <harm xml:id="harm-L13F6" type="beat" place="below" staff="1" tstamp="1.000000" n="6">
        <rend xml:id="rze9q60">1</rend>
       </harm>
       <harm xml:id="harm-L14F6" type="beat" place="below" staff="1" tstamp="1.500000" n="6">
        <rend xml:id="r1p7ta6f">1+1/3</rend>
       </harm>
       <beamSpan xml:id="b1t779j4" plist="#note-L13F5 #note-L14F5 #note-L16F5" startid="#note-L13F5" endid="#note-L16F5" />
      </measure>
      <measure xml:id="measure-L15" right="invis" n="2">
       <staff xml:id="staff-L15F5N1" n="1">
        <layer xml:id="layer-L15F5N1" n="1">
         <note xml:id="note-L16F5" dur="8" oct="4" pname="e" accid.ges="n" />
         <beam xml:id="beam-L17F5-L19F5">
          <note xml:id="note-L17F5" dur="8" oct="4" pname="f" accid.ges="n" />
          <note xml:id="note-L18F5" dur="8" oct="4" pname="g" accid.ges="n" />
          <note xml:id="note-L19F5" dur="8" oct="4" pname="a" accid.ges="n" />
         </beam>
         <barLine xml:id="barline-L20F5" form="single" />
        </layer>
       </staff>
       <staff xml:id="staff-L15F3N1" n="2">
        <layer xml:id="layer-L15F3N1" n="1">
         <note xml:id="note-L16F3" dur="4" oct="4" pname="d" accid.ges="n" />
         <note xml:id="note-L18F3" dur="4" oct="4" pname="e" accid.ges="n" />
         <barLine xml:id="barline-L20F3" form="single" />
        </layer>
       </staff>
       <staff xml:id="staff-L15F1N1" n="3">
        <layer xml:id="layer-L15F1N1" n="1">
         <note xml:id="note-L16F1" dur="4" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L18F1" dur="4" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
       <harm xml:id="harm-L16F2" type="beat" place="below" staff="3" tstamp="1.000000" n="2">
        <rend xml:id="r1u7qbvd">1</rend>
       </harm>
       <harm xml:id="harm-L16F4" type="beat" place="below" staff="2" tstamp="1.000000" n="4">
        <rend xml:id="rrge2vu">2</rend>
       </harm>
       <harm xml:id="harm-L16F6" type="beat" place="below" staff="1" tstamp="1.000000" n="6">
        <rend xml:id="r2wktzf">1+2/3</rend>
       </harm>
       <harm xml:id="harm-L17F6" type="beat" place="below" staff="1" tstamp="1.500000" n="6">
        <rend xml:id="r1iqdgsx">2</rend>
       </harm>
       <harm xml:id="harm-L18F2" type="beat" place="below" staff="3" tstamp="2.000000" n="2">
        <rend xml:id="r1cev15m">2</rend>
       </harm>
       <harm xml:id="harm-L18F4" type="beat" place="below" staff="2" tstamp="2.000000" n="4">
        <rend xml:id="rmvzuf">3</rend>
       </harm>
       <harm xml:id="harm-L18F6" type="beat" place="below" staff="1" tstamp="2.000000" n="6">
        <rend xml:id="r15m2lka">2+1/3</rend>
       </harm>
       <harm xml:id="harm-L19F6" type="beat" place="below" staff="1" tstamp="2.500000" n="6">
        <rend xml:id="r1rrlbv7">2+2/3</rend>
       </harm>
      </measure>
      <measure xml:id="measure-L20" right="invis">
       <staff xml:id="staff-L20F5N1" n="1">
        <layer xml:id="layer-L20F5N1" n="1">
         <beam xml:id="beam-L21F5-L23F5">
          <note xml:id="note-L21F5" dur="8" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L22F5" dur="8" oct="4" pname="d" accid.ges="n" />
          <note xml:id="note-L23F5" dur="8" oct="4" pname="e" accid.ges="n" />
         </beam>
         <note xml:id="note-L24F5" dur="8" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
       <staff xml:id="staff-L20F3N1" n="2">
        <layer xml:id="layer-L20F3N1" n="1">
         <note xml:id="note-L21F3" dur="4" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L23F3" dur="4" oct="4" pname="d" accid.ges="n" />
        </layer>
       </staff>
       <staff xml:id="staff-L20F1N1" n="3">
        <layer xml:id="layer-L20F1N1" n="1">
         <note xml:id="note-L21F1" dur="4" oct="4" pname="e" accid.ges="n" />
         <note xml:id="note-L23F1" dur="4" oct="4" pname="f" accid.ges="n" />
         <barLine xml:id="barline-L25F1" form="single" />
        </layer>
       </staff>
       <harm xml:id="harm-L21F2" type="beat" place="below" staff="3" tstamp="1.000000" n="2">
        <rend xml:id="rhscq36">3</rend>
       </harm>
       <harm xml:id="harm-L21F4" type="beat" place="below" staff="2" tstamp="1.000000" n="4">
        <rend xml:id="r1sfi8fx">1</rend>
       </harm>
       <harm xml:id="harm-L21F6" type="beat" place="below" staff="1" tstamp="1.000000" n="6">
        <rend xml:id="r8azomh">1</rend>
       </harm>
       <harm xml:id="harm-L22F6" type="beat" place="below" staff="1" tstamp="1.500000" n="6">
        <rend xml:id="rwn1fjf">1+1/3</rend>
       </harm>
       <harm xml:id="harm-L23F2" type="beat" place="below" staff="3" tstamp="2.000000" n="2">
        <rend xml:id="r11v4wxr">4</rend>
       </harm>
       <harm xml:id="harm-L23F4" type="beat" place="below" staff="2" tstamp="2.000000" n="4">
        <rend xml:id="r1bv5f5y">2</rend>
       </harm>
       <harm xml:id="harm-L23F6" type="beat" place="below" staff="1" tstamp="2.000000" n="6">
        <rend xml:id="r12l26or">1+2/3</rend>
       </harm>
       <harm xml:id="harm-L24F6" type="beat" place="below" staff="1" tstamp="2.500000" n="6">
        <rend xml:id="r7tr4zr">2</rend>
       </harm>
       <beamSpan xml:id="b13xd5cd" plist="#note-L24F5 #note-L26F5 #note-L27F5" startid="#note-L24F5" endid="#note-L27F5" />
      </measure>
      <measure xml:id="measure-L25" right="invis" n="3">
       <staff xml:id="staff-L25F5N1" n="1">
        <layer xml:id="layer-L25F5N1" n="1">
         <note xml:id="note-L26F5" dur="8" oct="4" pname="g" accid.ges="n" />
         <note xml:id="note-L27F5" dur="8" oct="4" pname="a" accid.ges="n" />
         <barLine xml:id="barline-L28F5" form="single" />
        </layer>
       </staff>
       <staff xml:id="staff-L25F3N1" n="2">
        <layer xml:id="layer-L25F3N1" n="1">
         <note xml:id="note-L26F3" dur="4" oct="4" pname="e" accid.ges="n" />
         <barLine xml:id="barline-L28F3" form="single" />
        </layer>
       </staff>
       <staff xml:id="staff-L25F1N1" n="3">
        <layer xml:id="layer-L25F1N1" n="1">
         <note xml:id="note-L26F1" dur="4" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
       <harm xml:id="harm-L26F2" type="beat" place="below" staff="3" tstamp="1.000000" n="2">
        <rend xml:id="rk0hpye">1</rend>
       </harm>
       <harm xml:id="harm-L26F4" type="beat" place="below" staff="2" tstamp="1.000000" n="4">
        <rend xml:id="r1e19qud">3</rend>
       </harm>
       <harm xml:id="harm-L26F6" type="beat" place="below" staff="1" tstamp="1.000000" n="6">
        <rend xml:id="rffa9dj">2+1/3</rend>
       </harm>
       <harm xml:id="harm-L27F6" type="beat" place="below" staff="1" tstamp="1.500000" n="6">
        <rend xml:id="rcs0939">2+2/3</rend>
       </harm>
      </measure>
      <measure xml:id="measure-L28" right="end">
       <staff xml:id="staff-L28F5N1" n="1">
        <layer xml:id="layer-L28F5N1" n="1">
         <beam xml:id="beam-L29F5-L31F5">
          <note xml:id="note-L29F5" dur="8" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L30F5" dur="8" oct="4" pname="d" accid.ges="n" />
          <note xml:id="note-L31F5" dur="8" oct="4" pname="e" accid.ges="n" />
         </beam>
         <beam xml:id="beam-L32F5-L34F5">
          <note xml:id="note-L32F5" dur="8" oct="4" pname="f" accid.ges="n" />
          <note xml:id="note-L33F5" dur="8" oct="4" pname="g" accid.ges="n" />
          <note xml:id="note-L34F5" dur="8" oct="4" pname="a" accid.ges="n" />
         </beam>
        </layer>
       </staff>
       <staff xml:id="staff-L28F3N1" n="2">
        <layer xml:id="layer-L28F3N1" n="1">
         <note xml:id="note-L29F3" dur="4" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L31F3" dur="4" oct="4" pname="d" accid.ges="n" />
         <note xml:id="note-L33F3" dur="4" oct="4" pname="e" accid.ges="n" />
        </layer>
       </staff>
       <staff xml:id="staff-L28F1N1" n="3">
        <layer xml:id="layer-L28F1N1" n="1">
         <note xml:id="note-L29F1" dur="4" oct="4" pname="d" accid.ges="n" />
         <note xml:id="note-L31F1" dur="4" oct="4" pname="e" accid.ges="n" />
         <note xml:id="note-L33F1" dur="4" oct="4" pname="f" accid.ges="n" />
        </layer>
       </staff>
       <harm xml:id="harm-L29F2" type="beat" place="below" staff="3" tstamp="1.000000" n="2">
        <rend xml:id="rzwwrby">2</rend>
       </harm>
       <harm xml:id="harm-L29F4" type="beat" place="below" staff="2" tstamp="1.000000" n="4">
        <rend xml:id="r1ohgp50">1</rend>
       </harm>
       <harm xml:id="harm-L29F6" type="beat" place="below" staff="1" tstamp="1.000000" n="6">
        <rend xml:id="r1i2pbr2">1</rend>
       </harm>
       <harm xml:id="harm-L30F6" type="beat" place="below" staff="1" tstamp="1.500000" n="6">
        <rend xml:id="r1vbt9wy">1+1/3</rend>
       </harm>
       <harm xml:id="harm-L31F2" type="beat" place="below" staff="3" tstamp="2.000000" n="2">
        <rend xml:id="r17ikjky">3</rend>
       </harm>
       <harm xml:id="harm-L31F4" type="beat" place="below" staff="2" tstamp="2.000000" n="4">
        <rend xml:id="rdnaqvo">2</rend>
       </harm>
       <harm xml:id="harm-L31F6" type="beat" place="below" staff="1" tstamp="2.000000" n="6">
        <rend xml:id="r1wqf50t">1+2/3</rend>
       </harm>
       <harm xml:id="harm-L32F6" type="beat" place="below" staff="1" tstamp="2.500000" n="6">
        <rend xml:id="r1xx9lim">2</rend>
       </harm>
       <harm xml:id="harm-L33F2" type="beat" place="below" staff="3" tstamp="3.000000" n="2">
        <rend xml:id="r63tp89">4</rend>
       </harm>
       <harm xml:id="harm-L33F4" type="beat" place="below" staff="2" tstamp="3.000000" n="4">
        <rend xml:id="rvukzi3">3</rend>
       </harm>
       <harm xml:id="harm-L33F6" type="beat" place="below" staff="1" tstamp="3.000000" n="6">
        <rend xml:id="r1calr9k">2+1/3</rend>
       </harm>
       <harm xml:id="harm-L34F6" type="beat" place="below" staff="1" tstamp="3.500000" n="6">
        <rend xml:id="roozfwv">2+2/3</rend>
       </harm>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

@tstamps on all staves are using meterSig@unit="4" from the bottom staff (so top staff is not using meterSig@unit="8" as it should).

@lpugin
Copy link
Contributor

@lpugin lpugin commented on 6938832 Sep 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@craigsapp I had a look at the issue #3515 . There is not simple fix, even though it would be possible. It think this is a case where having @qstamp would be much clearer and simpler. From the discussions on GH and in person, it seems that this is something for which there a consensus has been reached.

@craigsapp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think a @qstamp would be useful in these situations to avoid complexities of converting between @tstamps on different staves having different meterSig@units.

Issue #3515 can be closed if you like as this commit solves the problem for me for now.

Please sign in to comment.