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

Restarted section unrecognizable #2468

Closed rettinghaus closed 2 years ago

rettinghaus commented 2 years ago

Describe the problem A section restart marked as such should always be clearly visible.

To Reproduce Steps to reproduce the behavior:

  1. Load the data attached
  2. Render
  3. No visual indication of restarted section section

Expected behavior Restarting should add a minimal distance between sections: section_expected

Input data

<?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>Section restart</title>
         </titleStmt>
         <pubStmt>
            <respStmt/>
         </pubStmt>
      </fileDesc>
   </meiHead>
   <music>
      <body>
         <mdiv>
            <score>
               <scoreDef>
                  <staffGrp>
                     <staffDef n="1" lines="5">
                        <clef shape="G" line="2" visible="false" />
                        <meterSig count="4" unit="4" />
                     </staffDef>
                  </staffGrp>
               </scoreDef>
               <section>
                  <measure metcon="false">
                     <staff n="1">
                        <layer n="1">
                           <rest dur="2" />
                        </layer>
                        <layer n="2">
                           <note dur="4" oct="4" pname="c" stem.dir="down" />
                           <note xml:id="ex_0670680947" dur="4" oct="4" pname="d" stem.dir="down" />
                        </layer>
                     </staff>
                     <tie startid="#ex_0670680947" endid="#ex_0042585789" />
                  </measure>
                  <measure>
                     <staff n="1">
                        <layer n="1">
                           <mRest />
                        </layer>
                        <layer n="2">
                           <note xml:id="ex_0042585789" dur="2" oct="4" pname="d" stem.dir="down" />
                           <note dur="2" oct="4" pname="c" stem.dir="down" />
                        </layer>
                     </staff>
                  </measure>
               </section>
               <section restart="true">
                  <scoreDef>
                     <staffGrp>
                        <staffDef n="1" lines="5">
                           <meterSig count="4" unit="4" />
                        </staffDef>
                     </staffGrp>
                  </scoreDef>
                  <measure metcon="false">
                     <staff n="1">
                        <layer n="1">
                           <note xml:id="ex_1297524978" dur="2" oct="5" pname="f" stem.dir="up" />
                        </layer>
                        <layer n="2">
                           <rest dur="2" />
                        </layer>
                     </staff>
                     <tie startid="#ex_1297524978" endid="#ex_1511404477" />
                  </measure>
                  <measure>
                     <staff n="1">
                        <layer n="1">
                           <note xml:id="ex_1511404477" dur="2" oct="5" pname="f" stem.dir="up" />
                           <note dur="2" oct="5" pname="a" stem.dir="up" />
                        </layer>
                        <layer n="2">
                           <mRest />
                        </layer>
                     </staff>
                  </measure>
               </section>
            </score>
         </mdiv>
      </body>
   </music>
</mei>

Verovio information

Additional information Adding a label to the staffDef in the second section adds the expected space.

craigsapp commented 2 years ago

There is a (significant) corner case that is not handled properly yet:

When the music is not stretched to the full page width, the example is working:

Screen Shot 2021-11-26 at 2 22 48 AM

However, when the music is stretched to the page width (by narrowing the page width for this example), the gap disappears:

Screen Shot 2021-11-26 at 2 24 01 AM

There seems to be a general problem with the restart position in longer excerpts that span more than one system, where the restart gap is added to the end of the system rather than at the requested position in the score. Here is a longer example where there should be a restart after the pink D5 note after the double barline after measure 13:

Screen Shot 2021-11-26 at 2 34 04 AM Screen Shot 2021-11-26 at 2 35 19 AM Screen Shot 2021-11-26 at 2 35 48 AM
Click to view MEI data for above example ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2021-11-26T02:29:18" version="3.8.0-dev-851ef70"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="mlt41ja"> <score xml:id="sq1rmez"> <scoreDef xml:id="srlwd8p" midi.bpm="400.000000"> <staffGrp xml:id="s3gl7gz"> <staffDef xml:id="s5bsfuf" n="1" lines="5"> <clef xml:id="cxwtuzs" shape="G" line="2" /> <meterSig xml:id="metersig-L2F1" count="4" unit="4" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="s84v7aq" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L4F1" dur="1" oct="3" pname="f" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L5" n="2"> <staff xml:id="staff-L5F1N1" n="1"> <layer xml:id="layer-L5F1N1" n="1"> <note xml:id="note-L6F1" dur="1" oct="3" pname="g" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L7" n="3"> <staff xml:id="staff-L7F1N1" n="1"> <layer xml:id="layer-L7F1N1" n="1"> <note xml:id="note-L8F1" dur="1" oct="3" pname="a" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L9" n="4"> <staff xml:id="staff-L9F1N1" n="1"> <layer xml:id="layer-L9F1N1" n="1"> <note xml:id="note-L10F1" dur="1" oct="3" pname="b" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L11" n="5"> <staff xml:id="staff-L11F1N1" n="1"> <layer xml:id="layer-L11F1N1" n="1"> <note xml:id="note-L12F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L13" n="6"> <staff xml:id="staff-L13F1N1" n="1"> <layer xml:id="layer-L13F1N1" n="1"> <note xml:id="note-L14F1" dur="1" oct="4" pname="d" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L15" n="7"> <staff xml:id="staff-L15F1N1" n="1"> <layer xml:id="layer-L15F1N1" n="1"> <note xml:id="note-L16F1" dur="1" oct="4" pname="e" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L17" n="8"> <staff xml:id="staff-L17F1N1" n="1"> <layer xml:id="layer-L17F1N1" n="1"> <note xml:id="note-L18F1" dur="1" oct="4" pname="f" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L19" n="9"> <staff xml:id="staff-L19F1N1" n="1"> <layer xml:id="layer-L19F1N1" n="1"> <note xml:id="note-L20F1" dur="1" oct="4" pname="g" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L21" n="10"> <staff xml:id="staff-L21F1N1" n="1"> <layer xml:id="layer-L21F1N1" n="1"> <note xml:id="note-L22F1" dur="1" oct="4" pname="a" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L23" n="11"> <staff xml:id="staff-L23F1N1" n="1"> <layer xml:id="layer-L23F1N1" n="1"> <note xml:id="note-L24F1" dur="1" oct="4" pname="b" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L25" n="12"> <staff xml:id="staff-L25F1N1" n="1"> <layer xml:id="layer-L25F1N1" n="1"> <note xml:id="note-L26F1" dur="1" oct="5" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L27" n="13" right="end"> <staff xml:id="staff-L27F1N1" n="1"> <layer xml:id="layer-L27F1N1" n="1"> <note xml:id="note-L28F1" color="hotpink" dur="1" oct="5" pname="d" accid.ges="n" /> </layer> </staff> </measure> </section> <section restart="true"> <measure xml:id="measure-L29" n="14"> <staff xml:id="staff-L29F1N1" n="1"> <layer xml:id="layer-L29F1N1" n="1"> <note xml:id="note-L30F1" dur="1" oct="5" pname="e" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L31" n="15"> <staff xml:id="staff-L31F1N1" n="1"> <layer xml:id="layer-L31F1N1" n="1"> <note xml:id="note-L32F1" dur="1" oct="5" pname="f" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L33" n="16"> <staff xml:id="staff-L33F1N1" n="1"> <layer xml:id="layer-L33F1N1" n="1"> <note xml:id="note-L34F1" dur="1" oct="5" pname="g" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L35" n="17"> <staff xml:id="staff-L35F1N1" n="1"> <layer xml:id="layer-L35F1N1" n="1"> <note xml:id="note-L36F1" dur="1" oct="5" pname="a" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L37" n="18"> <staff xml:id="staff-L37F1N1" n="1"> <layer xml:id="layer-L37F1N1" n="1"> <note xml:id="note-L38F1" dur="1" oct="5" pname="b" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L39" n="19"> <staff xml:id="staff-L39F1N1" n="1"> <layer xml:id="layer-L39F1N1" n="1"> <note xml:id="note-L40F1" dur="1" oct="6" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L41" n="20"> <staff xml:id="staff-L41F1N1" n="1"> <layer xml:id="layer-L41F1N1" n="1"> <note xml:id="note-L42F1" dur="1" oct="6" pname="d" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L43" n="21"> <staff xml:id="staff-L43F1N1" n="1"> <layer xml:id="layer-L43F1N1" n="1"> <note xml:id="note-L44F1" dur="1" oct="6" pname="e" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L45" n="22"> <staff xml:id="staff-L45F1N1" n="1"> <layer xml:id="layer-L45F1N1" n="1"> <note xml:id="note-L46F1" dur="1" oct="6" pname="f" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L47" n="23"> <staff xml:id="staff-L47F1N1" n="1"> <layer xml:id="layer-L47F1N1" n="1"> <note xml:id="note-L48F1" dur="1" oct="6" pname="g" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L49" right="end" n="24"> <staff xml:id="staff-L49F1N1" n="1"> <layer xml:id="layer-L49F1N1" n="1"> <note xml:id="note-L50F1" dur="1" oct="6" pname="a" accid.ges="n" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/lpugin"><img src="https://avatars.githubusercontent.com/u/689412?v=4" />lpugin</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>Example added to the test suite <a href="https://github.com/rism-digital/verovio.org/blob/gh-pages/_tests/section/section_003.mei">https://github.com/rism-digital/verovio.org/blob/gh-pages/_tests/section/section_003.mei</a></p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>