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
686 stars 185 forks source link

diamond shaped noteheads + up stem interaction #2910

Closed craigsapp closed 2 years ago

craigsapp commented 2 years ago

Diamond shaped noteheads have problems attaching properly to up-stems:

Screen Shot 2022-06-03 at 8 29 57 AM
Click to view MEI data for above example ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2022-06-03T08:29:51" version="3.11.0-dev-fa769a1"> <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="!!!RDF**kern: > = above" xml:id="L12"> <frameInfo> <startTime float="2" /> <frameType>reference</frameType> <referenceKey>RDF**kern</referenceKey> <referenceValue>> = above</referenceValue> </frameInfo> </metaFrame> <metaFrame n="12" token="!!!RDF**kern: < = below" xml:id="L13"> <frameInfo> <startTime float="2" /> <frameType>reference</frameType> <referenceKey>RDF**kern</referenceKey> <referenceValue>< = below</referenceValue> </frameInfo> </metaFrame> </frames> </extMeta> </meiHead> <music> <body> <mdiv xml:id="m10e83p"> <score xml:id="stg17ns"> <scoreDef xml:id="sk23zsy"> <staffGrp xml:id="s9bigfg"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="clef-L2F1" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="invis"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <chord xml:id="chord-L6F1" dur="4"> <note xml:id="note-L6F1S1" oct="4" pname="e" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L6F1S2" oct="4" pname="g" accid.ges="n" /> <note xml:id="note-L6F1S3" oct="5" pname="c" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> <chord xml:id="chord-L9F1" type="placed" dur="4" stem.dir="down"> <note xml:id="note-L9F1S1" oct="4" pname="e" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L9F1S2" oct="4" pname="g" accid.ges="n" /> <note xml:id="note-L9F1S3" oct="5" pname="c" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>The problem in this case is that the stem is moved to diamond-shaped notes, but probably the diamond-shaped notes should be moved to the stem so that the regular note attached properly.</p> <p>When beamed, the opposite problem happens, where the regular notes are attached properly but the diamond-shaped notes do not (for up-stems):</p> <img width="357" alt="Screen Shot 2022-06-03 at 8 41 12 AM" src="https://user-images.githubusercontent.com/3487289/171896679-135fb961-a8ec-4f24-99c1-09567d4f93e9.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-06-03T08:41:48" version="3.11.0-dev-fa769a1"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="mhrkezp"> <score xml:id="skafftq"> <scoreDef xml:id="sfr8xdc"> <staffGrp xml:id="som5k1f"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="c3zg5t4" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="invis"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <beam xml:id="beam-L3F1-L11F1"> <chord xml:id="chord-L3F1" dur="16"> <note xml:id="note-L3F1S1" oct="4" pname="f" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L3F1S2" oct="5" pname="d" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> <note xml:id="note-L5F1" dur="16" oct="4" pname="g" head.fill="void" head.shape="diamond" accid.ges="n" /> <chord xml:id="chord-L8F1" dur="16"> <note xml:id="note-L8F1S1" oct="4" pname="g" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L8F1S2" oct="4" pname="b" accid.ges="n" /> <note xml:id="note-L8F1S3" oct="5" pname="e" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> <chord xml:id="chord-L11F1" dur="16"> <note xml:id="note-L11F1S1" oct="4" pname="f" accid.ges="n" /> <note xml:id="note-L11F1S2" oct="5" pname="c" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L11F1S3" oct="5" pname="d" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> </beam> <beam xml:id="beam-L13F1-L21F1" type="placed"> <chord xml:id="chord-L13F1" dur="16" stem.dir="up"> <note xml:id="note-L13F1S1" oct="4" pname="f" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L13F1S2" oct="5" pname="d" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> <note xml:id="note-L15F1" dur="16" oct="4" pname="g" head.fill="void" head.shape="diamond" stem.dir="up" accid.ges="n" /> <chord xml:id="chord-L18F1" dur="16" stem.dir="up"> <note xml:id="note-L18F1S1" oct="4" pname="g" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L18F1S2" oct="4" pname="b" accid.ges="n" /> <note xml:id="note-L18F1S3" oct="5" pname="e" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> <chord xml:id="chord-L21F1" dur="16" stem.dir="up"> <note xml:id="note-L21F1S1" oct="4" pname="f" accid.ges="n" /> <note xml:id="note-L21F1S2" oct="5" pname="c" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L21F1S3" oct="5" pname="d" head.fill="void" head.shape="diamond" accid.ges="n" /> </chord> </beam> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>The problem occurs because diamond shaped notes are smaller than regular noteheads and they are always left-aligned to the space that a regular notehead takes up. However, this needs to be adjusted for upstems. This applies to all non-standard noteheads shapes, and is already implemented for grace notes and cue notes:</p> <img width="288" alt="Screen Shot 2022-06-03 at 8 58 19 AM" src="https://user-images.githubusercontent.com/3487289/171902182-cf774967-4e07-4bd6-9b0d-3282c7837ae8.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-06-03T08:55:22" version="3.11.0-dev-fa769a1"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="m2hl4yg"> <score xml:id="sn0bqj5"> <scoreDef xml:id="swb95me"> <staffGrp xml:id="so72gte"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="cmmb6e8" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <chord xml:id="chord-L2F1" dur="4"> <note xml:id="note-L2F1S1" oct="4" pname="c" accid.ges="n" /> <note xml:id="note-L2F1S2" oct="4" pname="e" accid.ges="n" cue="true"/> <note xml:id="note-L2F1S3" oct="4" pname="g" accid.ges="n" /> </chord> <chord xml:id="chord-L3F1" type="placed" dur="4" stem.dir="down"> <note xml:id="note-L3F1S1" oct="4" pname="c" accid.ges="n" /> <note xml:id="note-L3F1S2" oct="4" pname="e" accid.ges="n" cue="true" /> <note xml:id="note-L3F1S3" oct="4" pname="g" accid.ges="n" /> </chord> </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/rettinghaus"><img src="https://avatars.githubusercontent.com/u/7693447?v=4" />rettinghaus</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>I'm wondering what should happen in chords <em>without</em> stem. Should all noteheads of different sizes stay left aligned, or should the be centered? @craigsapp maybe you could provide some examples from classic prints?</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> 2 years ago</strong> </div> <div class="markdown-body"> <p>Here is an example from Bartok: Sonata for Violin Solo, Sz.117 <a href="https://imslp.org/wiki/Sonata_for_Violin_Solo,_Sz.117_(Bart%C3%B3k,_B%C3%A9la">https://imslp.org/wiki/Sonata_for_Violin_Solo,_Sz.117_(Bart%C3%B3k,_B%C3%A9la</a>)</p> <img width="1384" alt="Screen Shot 2022-06-14 at 6 26 25 AM" src="https://user-images.githubusercontent.com/3487289/173588769-79b8f34c-6595-4763-b460-ae1dbf6123af.png"> <p>Page 13 of <a href="https://imslp.hk/files/imglnks/euimg/e/e6/IMSLP762149-PMLP980920-Barto-k_-_Violin_Sonata.pdf">https://imslp.hk/files/imglnks/euimg/e/e6/IMSLP762149-PMLP980920-Barto-k_-_Violin_Sonata.pdf</a></p> <p>It looks centered to me, but it is almost left justified:</p> <img width="858" alt="Screen Shot 2022-06-14 at 6 35 38 AM" src="https://user-images.githubusercontent.com/3487289/173590629-f08af05c-8ef9-40b2-899e-7de6e8c5a463.png"> <p>I think the goal they typesetter was trying to achieve was to align the diamond note with the top of the ellipse whole in the whole note:</p> <img width="627" alt="Screen Shot 2022-06-14 at 6 40 55 AM" src="https://user-images.githubusercontent.com/3487289/173591520-20e19660-1771-4f79-866b-101fc3236ed9.png"> <p>So in a sense it is centered, but how it is done makes it closer to left justified.</p> <p>Boosey & Hawkes edition:</p> <p><a href="https://imslp.hk/files/imglnks/euimg/a/ab/IMSLP609968-PMLP980920-Sonate_solo.pdf">https://imslp.hk/files/imglnks/euimg/a/ab/IMSLP609968-PMLP980920-Sonate_solo.pdf</a></p> <img width="1261" alt="Screen Shot 2022-06-14 at 6 44 09 AM" src="https://user-images.githubusercontent.com/3487289/173592238-933d26a3-bacd-4826-a2ac-f66d1bb13e4e.png"> <p>This one is intended to be centered on the widths of the notes:</p> <img width="494" alt="Screen Shot 2022-06-14 at 6 46 42 AM" src="https://user-images.githubusercontent.com/3487289/173592862-fa7930c0-0a39-4cd6-a004-932ac4b907ae.png"> <hr /> <p>I do not have any digital scores with this case (currently 475 artificial harmonics notes), mostly from this Opus:</p> <p>Wieniawski, Henryk: L'école moderne : etudes-caprices pour violon seul , op. 10 <a href="https://polona.pl/item/l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10,MTE2OTgzMTMy/25">https://polona.pl/item/l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10,MTE2OTgzMTMy/25</a> but have not found a case of harmonics on a whole note yet.</p> <p>Here is the printed version of the example used here (from the ending measures of the above linked page:</p> <img width="696" alt="Screen Shot 2022-06-14 at 5 56 39 AM" src="https://user-images.githubusercontent.com/3487289/173582792-3d5f2611-b7b5-4fe7-a2ba-f9ec25637fec.png"> <p>digital encoding: <a href="https://verovio.humdrum.org/?file=https%3A%2F%2Fdata.nifc.humdrum.org%2F18xx%3A3822.krn">https://verovio.humdrum.org/?file=https%3A%2F%2Fdata.nifc.humdrum.org%2F18xx%3A3822.krn</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>