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
665 stars 184 forks source link

mixed beam + rest interaction #3660

Open craigsapp opened 5 months ago

craigsapp commented 5 months ago

Related to discussion at https://github.com/music-encoding/music-encoding/issues/1461

The following example should have the beams in both measure be similar to the one in the first measure:

Screenshot 2024-04-29 at 10 45 08 AM
Click to view MEI data for above example. ```xml </titleStmt> <pubStmt> </pubStmt> </fileDesc> <encodingDesc> <appInfo> <application isodate="2024-04-29T10:42:40" version="4.2.0-dev-764d3d2-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> </meiHead> <music decls="#work1_encoded"> <body> <mdiv xml:id="mid4lan"> <score xml:id="s1nzk847"> <scoreDef xml:id="s2r15e0" tempo.dist="3.0000vu"> <staffGrp xml:id="snvnop0" bar.thru="true" symbol="brace"> <staffDef xml:id="staffdef-L1F2" n="1" lines="5"> <clef xml:id="clef-L2F2" shape="G" line="2" /> </staffDef> <staffDef xml:id="staffdef-L1F1" n="2" lines="5"> <clef xml:id="clef-L2F1" shape="F" line="4" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1"> <staff xml:id="staff-L1F2" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <space xml:id="space-L3F2" dur="4" /> </layer> </staff> <staff xml:id="staff-L1F1" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <beam xml:id="beam-L3F1-L4F1" beam.with="below"> <note xml:id="note-L3F1" type="placed" dur="8" oct="3" pname="c" stem.dir="up" accid.ges="n" /> <note xml:id="note-L4F1" type="placed" dur="8" staff="1" oct="5" pname="c" stem.dir="down" accid.ges="n" /> </beam> </layer> </staff> </measure> <measure xml:id="measure-L5" n="2"> <staff xml:id="staff-L5F2N1" n="1"> <layer xml:id="layer-L5F2N1" n="1"> <space xml:id="space-L6F2" dur="4" /> </layer> </staff> <staff xml:id="staff-L5F1N1" n="2"> <layer xml:id="layer-L5F1N1" n="1"> <beam xml:id="beam-L6F1-L7F1" beam.with="below"> <note xml:id="note-L6F1" type="placed" dur="8" oct="3" pname="c" stem.dir="up" accid.ges="n" /> <rest xml:id="rest-L7F1" dur="8" staff="1" ploc="b" oloc="4" /> </beam> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>The proposal is to used <code>beam@placed="mixed"</code> in such situations to clarify a mix-stem beam is wanted:</p> <p><a rel="noreferrer nofollow" target="_blank" href="https://music-encoding.org/guidelines/v5/data-types/data.BEAMPLACE.html">https://music-encoding.org/guidelines/v5/data-types/data.BEAMPLACE.html</a></p> <img width="939" alt="Screenshot 2024-04-29 at 11 52 51 AM" src="https://github.com/rism-digital/verovio/assets/3487289/7cecd140-5e45-40f6-be70-5536cd639c9a"> <p>Currently if <code>beam@place="mixed"</code> is used, verovio goes crazy:</p> <img width="197" alt="Screenshot 2024-04-29 at 11 54 36 AM" src="https://github.com/rism-digital/verovio/assets/3487289/e3af308b-9c06-449b-9b29-88b91b93574b"> <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/5.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?> <?xml-model href="https://music-encoding.org/schema/5.0/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"> <meiHead> <fileDesc> <titleStmt> <title /> </titleStmt> <pubStmt> </pubStmt> </fileDesc> <encodingDesc> <appInfo> <application isodate="2024-04-29T10:42:40" version="4.2.0-dev-764d3d2-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> </meiHead> <music decls="#work1_encoded"> <body> <mdiv xml:id="mid4lan"> <score xml:id="s1nzk847"> <scoreDef xml:id="s2r15e0" tempo.dist="3.0000vu"> <staffGrp xml:id="snvnop0" bar.thru="true" symbol="brace"> <staffDef xml:id="staffdef-L1F2" n="1" lines="5"> <clef xml:id="clef-L2F2" shape="G" line="2" /> </staffDef> <staffDef xml:id="staffdef-L1F1" n="2" lines="5"> <clef xml:id="clef-L2F1" shape="F" line="4" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1"> <staff xml:id="staff-L1F2" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <space xml:id="space-L3F2" dur="4" /> </layer> </staff> <staff xml:id="staff-L1F1" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <beam xml:id="beam-L3F1-L4F1" beam.with="below"> <note xml:id="note-L3F1" type="placed" dur="8" oct="3" pname="c" stem.dir="up" accid.ges="n" /> <note xml:id="note-L4F1" type="placed" dur="8" staff="1" oct="5" pname="c" stem.dir="down" accid.ges="n" /> </beam> </layer> </staff> </measure> <measure xml:id="measure-L5" n="2"> <staff xml:id="staff-L5F2N1" n="1"> <layer xml:id="layer-L5F2N1" n="1"> <space xml:id="space-L6F2" dur="4" /> </layer> </staff> <staff xml:id="staff-L5F1N1" n="2"> <layer xml:id="layer-L5F1N1" n="1"> <beam xml:id="beam-L6F1-L7F1" beam.with="below" place="mixed" > <note xml:id="note-L6F1" type="placed" dur="8" oct="3" pname="c" stem.dir="up" accid.ges="n" /> <rest xml:id="rest-L7F1" dur="8" staff="1" ploc="b" oloc="4" /> </beam> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Some infinities are probably generated, and the second staff rendering is aborted. I only added <code>@place="mixed"</code> for the second measure beam, when adding `@place="mixed" to the first beam there is no problem, so it is related to getting the non-stem direction of the rest most likely.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/craigsapp"><img src="https://avatars.githubusercontent.com/u/3487289?v=4" />craigsapp</a> commented <strong> 5 months ago</strong> </div> <div class="markdown-body"> <p>See also older discussion about mixed-stem beams: <a href="https://github.com/music-encoding/music-encoding/issues/690">https://github.com/music-encoding/music-encoding/issues/690</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>