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
662 stars 183 forks source link

Missing implementation of some note@head.shapes #3798

Open stereomatchingkiss opened 3 hours ago

stereomatchingkiss commented 3 hours ago

Verovio version == 4.3.1

What I tried

<note xml:id="n1wmxbyj" dur.ppq="8" dur="4" oct="4" pname="d" stem.dir="down" shape="diamond"/>
<note xml:id="n1wmxbyj" dur.ppq="8" dur="4" oct="4" pname="d" stem.dir="down" head.shape="diamond"/>
<note xml:id="n1wmxbyj" dur.ppq="8" dur="4" oct="4" pname="d" stem.dir="down" headshape="diamond"/>

Everyone of them do not work, do verovio support changing shape? I check the source codes, changelog.md do mentioned "Support fornote@head.fillwith@headshape="diammond""

But not sure how could I make this work, thanks

Edit : Tried with diammond too

craigsapp commented 3 hours ago

It should be the second one, @head.shape. Here is viewing in the most recent version of verovio develop branch:

Screenshot 2024-09-22 at 8 43 50 PM
Click to view MEI data for above example ```xml </titleStmt> <pubStmt> </pubStmt> </fileDesc> <encodingDesc> <appInfo> <application isodate="2024-09-22T20:43:41" version="4.3.0-dev-bf6b697-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <extMeta> <frames xmlns="http://www.humdrum.org/ns/humxml" /> </extMeta> </meiHead> <music decls="#work1_encoded"> <body> <mdiv xml:id="mb2lo6u"> <score xml:id="sxq1agr"> <scoreDef xml:id="s1lxa7hc" tempo.dist="3.0000vu"> <staffGrp xml:id="sasko47"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="cocfzzl" 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"> <staff xml:id="staff-L1F1" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L4F1" dur="4" oct="4" pname="c" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L6F1" dur="4" oct="4" pname="d" head.fill="void" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L8F1" dur="4" oct="4" pname="e" head.shape="x" accid.ges="n" /> <note xml:id="note-L10F1" dur="4" oct="4" pname="f" head.shape="slash" accid.ges="n" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <pre><code class="language-xml"><note dur="4" oct="4" pname="c" head.shape="diamond" /> <note dur="4" oct="4" pname="d" head.fill="void" head.shape="diamond" /> <note dur="4" oct="4" pname="e" head.shape="x" /> <note dur="4" oct="4" pname="f" head.shape="slash" /></code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/stereomatchingkiss"><img src="https://avatars.githubusercontent.com/u/1801914?v=4" />stereomatchingkiss</a> commented <strong> 3 hours ago</strong> </div> <div class="markdown-body"> <p>Thanks, it works. I checked the source codes(StrToHeadshapeList), tried every examples, find out following do not works</p> <pre><code class="language-xml"><note dur="4" oct="4" pname="f" head.shape="quarter" /> <note dur="4" oct="4" pname="f" head.shape="rectangle" /> <note dur="4" oct="4" pname="f" head.shape="backslash" /> <note dur="4" oct="4" pname="f" head.shape="isotriangle" /> <note dur="4" oct="4" pname="f" head.shape="oval" /> <note dur="4" oct="4" pname="f" head.shape="rtriangle" /> <note dur="4" oct="4" pname="f" head.shape="piewedge" /> <note dur="4" oct="4" pname="f" head.shape="semicircle" /> <note dur="4" oct="4" pname="f" head.shape="square" /></code></pre> <p>I guess one of them is the default shape(it works, but since it is default shape I do not find out), but not sure which one</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/stereomatchingkiss"><img src="https://avatars.githubusercontent.com/u/1801914?v=4" />stereomatchingkiss</a> commented <strong> 3 hours ago</strong> </div> <div class="markdown-body"> <p>About the source codes locate in the file attconverter.cpp</p> <pre><code class="language-cpp">data_HEADSHAPE_list AttConverterBase::StrToHeadshapeList(const std::string &value, bool logWarning) const { if (value == "quarter") return HEADSHAPE_list_quarter; if (value == "half") return HEADSHAPE_list_half; if (value == "whole") return HEADSHAPE_list_whole; if (value == "backslash") return HEADSHAPE_list_backslash; if (value == "circle") return HEADSHAPE_list_circle; if (value == "+") return HEADSHAPE_list_plus; if (value == "diamond") return HEADSHAPE_list_diamond; if (value == "isotriangle") return HEADSHAPE_list_isotriangle; if (value == "oval") return HEADSHAPE_list_oval; if (value == "piewedge") return HEADSHAPE_list_piewedge; if (value == "rectangle") return HEADSHAPE_list_rectangle; if (value == "rtriangle") return HEADSHAPE_list_rtriangle; if (value == "semicircle") return HEADSHAPE_list_semicircle; if (value == "slash") return HEADSHAPE_list_slash; if (value == "square") return HEADSHAPE_list_square; if (value == "x") return HEADSHAPE_list_x; if (logWarning && !value.empty()) LogWarning("Unsupported value '%s' for data.HEADSHAPE.list", value.c_str()); return HEADSHAPE_list_NONE; } </code></pre> </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 hours ago</strong> </div> <div class="markdown-body"> <p>The notes marked in red have notehead shapes that are not implemented in verovio (but it knows that they are supposed to exist):</p> <img width="806" alt="Screenshot 2024-09-22 at 9 29 00 PM" src="https://github.com/user-attachments/assets/c41daf74-a4da-4e35-b9ee-fbafe71207e3"> <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-09-22T20:43:41" version="4.3.0-dev-bf6b697-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <extMeta> <frames xmlns="http://www.humdrum.org/ns/humxml" /> </extMeta> </meiHead> <music decls="#work1_encoded"> <body> <mdiv xml:id="mb2lo6u"> <score xml:id="sxq1agr"> <scoreDef xml:id="s1lxa7hc" tempo.dist="3.0000vu"> <staffGrp xml:id="sasko47"> <staffDef xml:id="staffdef-L1F1" n="1" lines="5"> <clef xml:id="cocfzzl" shape="G" line="2" /> <meterSig xml:id="metersig-L2F1" count="17" unit="4" /> </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"> <note xml:id="note-L4F1" dur="2" oct="4" pname="c" head.shape="quarter" accid.ges="n" /> <note xml:id="note-L6F1" dur="4" oct="4" pname="d" head.shape="half" accid.ges="n" /> <note xml:id="note-L8F1" dur="4" oct="4" pname="e" head.shape="whole" accid.ges="n" /> <note xml:id="note-L10F1" color="red" dur="4" oct="4" pname="f" head.shape="backslash" accid.ges="n" /> <note xml:id="note-L11F1" color="red" dur="4" oct="4" pname="f" head.shape="circle" accid.ges="n" /> <note xml:id="note-L12F1" dur="4" oct="4" pname="f" head.shape="+" accid.ges="n" /> <note xml:id="note-L13F1" dur="4" oct="4" pname="f" head.shape="diamond" accid.ges="n" /> <note xml:id="note-L14F1" color="red" dur="4" oct="4" pname="f" head.shape="isotriangle" accid.ges="n" /> <note xml:id="note-L15F1" color="red" dur="4" oct="4" pname="f" head.shape="oval" accid.ges="n" /> <note xml:id="note-L16F1" color="red" dur="4" oct="4" pname="f" head.shape="piewedge" accid.ges="n" /> <note xml:id="note-L17F1" color="red" dur="4" oct="4" pname="f" head.shape="rectangle" accid.ges="n" /> <note xml:id="note-L18F1" color="red" dur="4" oct="4" pname="f" head.shape="rtriangle" accid.ges="n" /> <note xml:id="note-L19F1" color="red" dur="4" oct="4" pname="f" head.shape="semicirclel" accid.ges="n" /> <note xml:id="note-L20F1" dur="4" oct="4" pname="f" head.shape="slash" accid.ges="n" /> <note xml:id="note-L21F1" color="red" dur="4" oct="4" pname="f" head.shape="square" accid.ges="n" /> <note xml:id="note-L22F1" dur="4" oct="4" pname="f" head.shape="x" accid.ges="n" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Notes in example data:</p> <pre><code class="language-xml"><note dur="2" oct="4" pname="c" head.shape="quarter" /> <note dur="4" oct="4" pname="d" head.shape="half" /> <note dur="4" oct="4" pname="e" head.shape="whole" /> <note color="red" dur="4" oct="4" pname="f" head.shape="backslash" /> <note color="red" dur="4" oct="4" pname="f" head.shape="circle" /> <note dur="4" oct="4" pname="f" head.shape="+" /> <note dur="4" oct="4" pname="f" head.shape="diamond" /> <note color="red" dur="4" oct="4" pname="f" head.shape="isotriangle" /> <note color="red" dur="4" oct="4" pname="f" head.shape="oval" /> <note color="red" dur="4" oct="4" pname="f" head.shape="piewedge" /> <note color="red" dur="4" oct="4" pname="f" head.shape="rectangle" /> <note color="red" dur="4" oct="4" pname="f" head.shape="rtriangle" /> <note color="red" dur="4" oct="4" pname="f" head.shape="semicirclel" /> <note dur="4" oct="4" pname="f" head.shape="slash" /> <note color="red" dur="4" oct="4" pname="f" head.shape="square" /> <note dur="4" oct="4" pname="f" head.shape="x" /></code></pre> </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 hours ago</strong> </div> <div class="markdown-body"> <p>Here are the SMuFL notehead shapes (not exactly a one-to-one mapping for all MEI notehead shapes, which is probably the main problem with implementation):</p> <p><a href="https://w3c.github.io/smufl/latest/tables/noteheads.html">https://w3c.github.io/smufl/latest/tables/noteheads.html</a></p> <p>But ones that do map:</p> <p><code>isotriangle</code> (SMuFL has duration qualifications for this shape):</p> <img width="535" alt="Screenshot 2024-09-22 at 9 43 52 PM" src="https://github.com/user-attachments/assets/fd55df6d-11f2-4aed-8fad-039f4e615219"> <img width="676" alt="Screenshot 2024-09-22 at 9 45 22 PM" src="https://github.com/user-attachments/assets/a7c3e513-d6d2-4195-8f27-3fb4f307ee7d"> <p><code>square</code> (they don't look square in SMuFL versions and maybe map better to <code>rectangle</code>):</p> <img width="1288" alt="Screenshot 2024-09-22 at 9 46 29 PM" src="https://github.com/user-attachments/assets/92248a2a-40a5-476e-8d5f-859c62733f96"> <p><code>+</code> has duration qualifications, which verovio does not yet address:</p> <img width="1220" alt="Screenshot 2024-09-22 at 9 47 57 PM" src="https://github.com/user-attachments/assets/3200c985-0786-4ba8-99f7-7edf5a799c9c"> <p><code>triangle</code> (don't know what <code>rtriangle</code> is supposed to mean unless it is the same shape other than if the stems are attached to the point rather than the side):</p> <img width="663" alt="Screenshot 2024-09-22 at 9 48 49 PM" src="https://github.com/user-attachments/assets/65946bbb-e5b7-40d2-aadb-cde13110017c"> <img width="620" alt="Screenshot 2024-09-22 at 9 48 42 PM" src="https://github.com/user-attachments/assets/1ba340c4-c324-4045-a024-d7718eb3a239"> <p><code>semicircle</code> might map to SMuFL<code>moon</code>:</p> <img width="1286" alt="Screenshot 2024-09-22 at 9 49 38 PM" src="https://github.com/user-attachments/assets/0f210ed4-2ec9-47d8-aba3-731d8121dea9"> <p><code>piewedge</code> might map to these:</p> <img width="1347" alt="Screenshot 2024-09-22 at 9 50 42 PM" src="https://github.com/user-attachments/assets/5f922c7d-05c9-41da-b5f6-9142ba7793e4"> <p>Nothing looks like it maps to <code>oval</code>, and <code>backslash</code> is probably in the SMuFL font related to <code>slash</code> which is not on this page.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/stereomatchingkiss"><img src="https://avatars.githubusercontent.com/u/1801914?v=4" />stereomatchingkiss</a> commented <strong> 1 hour ago</strong> </div> <div class="markdown-body"> <p>Tried to implement square by myself, quite difficult to do. Could you give me some suggestions of implementing this shape for the note? Should I start from SMuFL? Thanks</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>