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

Rhythm alignment problem in mensural notation #2691

Closed craigsapp closed 2 years ago

craigsapp commented 2 years ago

The following example has problems aligning after the first <barLine>:

Screen Shot 2022-03-05 at 9 13 46 AM
Click to view MEI data for above example ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2022-03-05T09:09:34" version="3.10.0-dev-8f3b9e0"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="msk9bz1"> <score xml:id="sizp8j0"> <scoreDef xml:id="shx7kkv" midi.bpm="400.000000"> <staffGrp xml:id="snp4aq" symbol="bracket"> <staffDef xml:id="sloxq2c" n="1" notationtype="mensural.black" lines="5"> <label xml:id="label-L4F3">Cantus</label> <clef xml:id="clef-L5F3" shape="G" line="2" /> <keySig xml:id="keysig-L7F3" sig="0" /> <instrDef xml:id="ir0r92o" midi.instrnum="52" midi.instrname="Choir_Aahs" /> </staffDef> <staffDef xml:id="sxpfwlq" n="2" notationtype="mensural.black" lines="5"> <label xml:id="label-L4F2">Tenor</label> <clef xml:id="clef-L5F2" shape="C" line="2" /> <keySig xml:id="keysig-L7F2" sig="0" /> <instrDef xml:id="i4szxzu" midi.instrnum="52" midi.instrname="Choir_Aahs" /> </staffDef> <staffDef xml:id="su1si0i" n="3" notationtype="mensural.black" lines="5"> <label xml:id="label-L4F1">Bassus</label> <clef xml:id="clef-L5F1" shape="C" line="3" /> <keySig xml:id="keysig-L7F1" sig="0" /> <instrDef xml:id="ixs6d3y" midi.instrnum="52" midi.instrname="Choir_Aahs" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <staff xml:id="sw5japn" n="1"> <layer xml:id="layer-L1F3N1" n="1"> <mensur xml:id="mensur-L8F3" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" /> <note xml:id="note-L10F3" dur="semibrevis" oct="5" pname="d" /> <note xml:id="note-L11F3" dur="minima" oct="5" pname="d" /> <note xml:id="note-L12F3" dur="minima" oct="5" pname="d" /> <barLine xml:id="barline-L13F3" /> <note xml:id="note-L14F3" dur="semibrevis" oct="4" pname="b" /> <note xml:id="note-L16F3" dur="minima" oct="5" pname="c" /> <note xml:id="note-L17F3" dur="minima" oct="4" pname="a" /> <barLine xml:id="barline-L18F3" /> </layer> </staff> <staff xml:id="s7eyjp4" n="2"> <layer xml:id="layer-L1F2N1" n="1"> <mensur xml:id="mensur-L8F2" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" /> <rest xml:id="rest-L10F2" dur="brevis" /> <barLine xml:id="barline-L13F2" /> <rest xml:id="rest-L14F2" dur="brevis" /> <barLine xml:id="barline-L18F2" /> </layer> </staff> <staff xml:id="suzs6wz" n="3"> <layer xml:id="layer-L1F1N1" n="1"> <mensur xml:id="mensur-L8F1" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" /> <rest xml:id="rest-L10F1" dur="semibrevis" /> <note xml:id="note-L11F1" dur="semibrevis" oct="4" pname="g" /> <barLine xml:id="barline-L13F1" /> <note xml:id="note-L14F1" dur="minima" oct="4" pname="g" /> <note xml:id="note-L15F1" dur="minima" oct="4" pname="g" /> <note xml:id="note-L16F1" dur="minima" oct="4" pname="e" /> <note xml:id="note-L17F1" dur="minima" oct="4" pname="f" /> <barLine xml:id="barline-L18F1" /> </layer> </staff> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>The input file seems correct, so I am suspecting something related to internal promotion of <code><barLine></code> groupings into <code><measure></code>s.</p> <p>When one of the barlines is removed, the alignment is correct for the entire measure (presumably since all of the music is now in a single virtual <code><measure></code>):</p> <img width="532" alt="Screen Shot 2022-03-05 at 9 17 08 AM" src="https://user-images.githubusercontent.com/3487289/156893419-89c92003-4766-47ec-a229-55332b5b052e.png"> <details> <summary> Click to view MEI data for above example </summary> ```xml <?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="2022-03-05T09:09:34" version="3.10.0-dev-8f3b9e0"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="msk9bz1"> <score xml:id="sizp8j0"> <scoreDef xml:id="shx7kkv" midi.bpm="400.000000"> <staffGrp xml:id="snp4aq" symbol="bracket"> <staffDef xml:id="sloxq2c" n="1" notationtype="mensural.black" lines="5"> <label xml:id="label-L4F3">Cantus</label> <clef xml:id="clef-L5F3" shape="G" line="2" /> <keySig xml:id="keysig-L7F3" sig="0" /> <instrDef xml:id="ir0r92o" midi.instrnum="52" midi.instrname="Choir_Aahs" /> </staffDef> <staffDef xml:id="sxpfwlq" n="2" notationtype="mensural.black" lines="5"> <label xml:id="label-L4F2">Tenor</label> <clef xml:id="clef-L5F2" shape="C" line="2" /> <keySig xml:id="keysig-L7F2" sig="0" /> <instrDef xml:id="i4szxzu" midi.instrnum="52" midi.instrname="Choir_Aahs" /> </staffDef> <staffDef xml:id="su1si0i" n="3" notationtype="mensural.black" lines="5"> <label xml:id="label-L4F1">Bassus</label> <clef xml:id="clef-L5F1" shape="C" line="3" /> <keySig xml:id="keysig-L7F1" sig="0" /> <instrDef xml:id="ixs6d3y" midi.instrnum="52" midi.instrname="Choir_Aahs" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <staff xml:id="sw5japn" n="1"> <layer xml:id="layer-L1F3N1" n="1"> <mensur xml:id="mensur-L8F3" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" /> <note xml:id="note-L10F3" dur="semibrevis" oct="5" pname="d" /> <note xml:id="note-L11F3" dur="minima" oct="5" pname="d" /> <note xml:id="note-L12F3" dur="minima" oct="5" pname="d" /> <barLine xml:id="barline-L13F3" /> <note xml:id="note-L14F3" dur="semibrevis" oct="4" pname="b" /> <note xml:id="note-L16F3" dur="minima" oct="5" pname="c" /> <note xml:id="note-L17F3" dur="minima" oct="4" pname="a" /> <barLine xml:id="barline-L18F3" /> </layer> </staff> <staff xml:id="s7eyjp4" n="2"> <layer xml:id="layer-L1F2N1" n="1"> <mensur xml:id="mensur-L8F2" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" /> <rest xml:id="rest-L10F2" dur="brevis" /> <barLine xml:id="barline-L13F2" /> <rest xml:id="rest-L14F2" dur="brevis" /> <barLine xml:id="barline-L18F2" /> </layer> </staff> <staff xml:id="suzs6wz" n="3"> <layer xml:id="layer-L1F1N1" n="1"> <mensur xml:id="mensur-L8F1" modusmaior="2" modusminor="2" prolatio="2" tempus="2" sign="C" slash="1" /> <rest xml:id="rest-L10F1" dur="semibrevis" /> <note xml:id="note-L11F1" dur="semibrevis" oct="4" pname="g" /> <note xml:id="note-L14F1" dur="minima" oct="4" pname="g" /> <note xml:id="note-L15F1" dur="minima" oct="4" pname="g" /> <note xml:id="note-L16F1" dur="minima" oct="4" pname="e" /> <note xml:id="note-L17F1" dur="minima" oct="4" pname="f" /> <barLine xml:id="barline-L18F1" /> </layer> </staff> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Related to issues <a rel="noreferrer nofollow" target="_blank" href="https://github.com/rism-digital/verovio/issues/2690">https://github.com/rism-digital/verovio/issues/2690</a> and <a rel="noreferrer nofollow" target="_blank" href="https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/654">https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/654</a>.</p> </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><img src="https://user-images.githubusercontent.com/689412/158203076-3bbf1ae4-1ab5-4047-9eb1-eda03f0d6e19.png" alt="image" /></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>