humdrum-tools / verovio-humdrum-viewer

Verovio Humdrum Viewer
http://verovio.humdrum.org
36 stars 9 forks source link

Implement secondary transpositions #858

Open craigsapp opened 8 months ago

craigsapp commented 8 months ago

Only the first transposition (in D) is transferred in the Humdrum-to-MEI conversion:

Screenshot 2023-10-16 at 07 09 16

View in VHV

**kern  **kern
*k[]    *k[]
*I"not transposed   *I"transposed
=   =
*   *ITrd-1c-2
*   *k[]
!   !LO:TX:t=in D
1c  1cc
=|| =||
*   *ITrd1c2
*   *k[]
!   !LO:TX:t=in B-flat
1c  1cc
=|| =||
*   *ITrd2c3
*   *k[]
!   !LO:TX:t=in A
1c  1cc
=|| =||
*   *ITrd-2c-3
*   *k[]
!   !LO:TX:t=in E-flat
1c  1cc
==  ==
*-  *-
Click to view MEI conversion of example ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-10-16T07:11:01" version="4.1.0-dev-b3d4df4-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="m1f9ss9"> <score xml:id="srodt2k"> <scoreDef xml:id="s2r48fs" midi.bpm="400.000000"> <staffGrp xml:id="sodlprw" bar.thru="true" symbol="brace"> <staffDef xml:id="staffdef-L1F2" n="1" lines="5" trans.diat="1" trans.semi="2"> <label xml:id="label-L3F2">transposed</label> <clef xml:id="cnbkw06" shape="G" line="2" /> <keySig xml:id="keysig-L6F2" sig="2f" /> </staffDef> <staffDef xml:id="staffdef-L1F1" n="2" lines="5"> <label xml:id="label-L3F1">not transposed</label> <clef xml:id="c7komp5" shape="G" line="2" /> <keySig xml:id="keysig-L2F1" sig="0" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="dbl"> <staff xml:id="staff-L1F2" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L8F2" dur="1" oct="4" pname="b" accid.ges="f" /> </layer> </staff> <staff xml:id="staff-L1F1" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L8F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L7F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r4yoq2u" fontstyle="normal">in D</rend> </dir> </measure> <scoreDef xml:id="s1gj6gao"> <staffGrp xml:id="s1t4h1yd"> <staffDef xml:id="sojdjge" n="1"> <keySig xml:id="keysig-L11F2" sig="2s" /> </staffDef> </staffGrp> </scoreDef> <measure xml:id="measure-L9" right="dbl"> <staff xml:id="staff-L9F2N1" n="1"> <layer xml:id="layer-L9F2N1" n="1"> <note xml:id="note-L13F2" dur="1" oct="5" pname="d" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L9F1N1" n="2"> <layer xml:id="layer-L9F1N1" n="1"> <note xml:id="note-L13F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L12F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r1r2xu6g" fontstyle="normal">in B-flat</rend> </dir> </measure> <scoreDef xml:id="s1pvhlov"> <staffGrp xml:id="s1xd2d2q"> <staffDef xml:id="s5gt4lw" n="1"> <keySig xml:id="keysig-L16F2" sig="3f" /> </staffDef> </staffGrp> </scoreDef> <measure xml:id="measure-L14" right="dbl"> <staff xml:id="staff-L14F2N1" n="1"> <layer xml:id="layer-L14F2N1" n="1"> <note xml:id="note-L18F2" dur="1" oct="5" pname="e" accid.ges="f" /> </layer> </staff> <staff xml:id="staff-L14F1N1" n="2"> <layer xml:id="layer-L14F1N1" n="1"> <note xml:id="note-L18F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L17F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r1vnbxbo" fontstyle="normal">in A</rend> </dir> </measure> <scoreDef xml:id="s11ux1xk"> <staffGrp xml:id="s1hw4lzq"> <staffDef xml:id="s1kh0tmv" n="1"> <keySig xml:id="keysig-L21F2" sig="3s" /> </staffDef> </staffGrp> </scoreDef> <measure xml:id="measure-L19" right="end"> <staff xml:id="staff-L19F2N1" n="1"> <layer xml:id="layer-L19F2N1" n="1"> <note xml:id="note-L23F2" dur="1" oct="4" pname="a" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L19F1N1" n="2"> <layer xml:id="layer-L19F1N1" n="1"> <note xml:id="note-L23F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L22F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r11lstgi" fontstyle="normal">in E-flat</rend> </dir> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </detail> --------------- A secondary problem is that there should be a flat sign on the B-flat in D and E-flat in A when there are no key signatures (this is often needed for French horns, for example): <img width="585" alt="Screenshot 2023-10-16 at 07 17 25" src="https://github.com/humdrum-tools/verovio-humdrum-viewer/assets/3487289/afe465c9-56a4-498f-affd-530a41ab9179"> [View in VHV](https://verovio.humdrum.org?t=KiprZXJuCSoqa2VybgoqSSJub3QgdHJhbnNwb3NlZAkqSSJ0cmFuc3Bvc2VkCj0JPQoqCSpJVHJkLTFjLTIKIQkhTE86VFg6dD1pbiBECjFjCTFjYwo9fHwJPXx8CioJKklUcmQxYzIKIQkhTE86VFg6dD1pbiBCLWZsYXQKMWMJMWNjCj18fAk9fHwKKgkqSVRyZDJjMwohCSFMTzpUWDp0PWluIEEKMWMJMWNjCj18fAk9fHwKKgkqSVRyZC0yYy0zCiEJIUxPOlRYOnQ9aW4gRS1mbGF0CjFjCTFjYwo9PQk9PQoqLQkqLQo=) The MEI conversion places the accidental in `@accid.ges`, but they should be in `@accid`: <details> <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 /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2023-10-16T07:21:35" version="4.1.0-dev-b3d4df4-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="mow63q5"> <score xml:id="s17r2rtg"> <scoreDef xml:id="s2bo3b3" midi.bpm="400.000000"> <staffGrp xml:id="s1547gwq" bar.thru="true" symbol="brace"> <staffDef xml:id="staffdef-L1F2" n="1" lines="5" trans.diat="1" trans.semi="2"> <label xml:id="label-L2F2">transposed</label> <clef xml:id="c1cr96gv" shape="G" line="2" /> </staffDef> <staffDef xml:id="staffdef-L1F1" n="2" lines="5"> <label xml:id="label-L2F1">not transposed</label> <clef xml:id="c1hyrlf0" shape="G" line="2" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" right="dbl"> <staff xml:id="staff-L1F2" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L6F2" dur="1" oct="4" pname="b" accid.ges="f" /> </layer> </staff> <staff xml:id="staff-L1F1" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L6F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L5F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="rnw3uby" fontstyle="normal">in D</rend> </dir> </measure> <scoreDef xml:id="s4k1cau"> <staffGrp xml:id="s1pvybqc"> <staffDef xml:id="s1chk8pr" n="1" /> </staffGrp> </scoreDef> <measure xml:id="measure-L7" right="dbl"> <staff xml:id="staff-L7F2N1" n="1"> <layer xml:id="layer-L7F2N1" n="1"> <note xml:id="note-L10F2" dur="1" oct="5" pname="d" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L7F1N1" n="2"> <layer xml:id="layer-L7F1N1" n="1"> <note xml:id="note-L10F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L9F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r197nb0u" fontstyle="normal">in B-flat</rend> </dir> </measure> <scoreDef xml:id="smlfoji"> <staffGrp xml:id="s1rarjhi"> <staffDef xml:id="sydtw1b" n="1" /> </staffGrp> </scoreDef> <measure xml:id="measure-L11" right="dbl"> <staff xml:id="staff-L11F2N1" n="1"> <layer xml:id="layer-L11F2N1" n="1"> <note xml:id="note-L14F2" dur="1" oct="5" pname="e" accid.ges="f" /> </layer> </staff> <staff xml:id="staff-L11F1N1" n="2"> <layer xml:id="layer-L11F1N1" n="1"> <note xml:id="note-L14F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L13F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r1ovf5gj" fontstyle="normal">in A</rend> </dir> </measure> <scoreDef xml:id="s66qora"> <staffGrp xml:id="s17pzkcg"> <staffDef xml:id="s1pkwj7j" n="1" /> </staffGrp> </scoreDef> <measure xml:id="measure-L15" right="end"> <staff xml:id="staff-L15F2N1" n="1"> <layer xml:id="layer-L15F2N1" n="1"> <note xml:id="note-L18F2" dur="1" oct="4" pname="a" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L15F1N1" n="2"> <layer xml:id="layer-L15F1N1" n="1"> <note xml:id="note-L18F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L17F2" place="above" staff="1" tstamp="1.000000"> <rend xml:id="rj72elv" fontstyle="normal">in E-flat</rend> </dir> </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/craigsapp"><img src="https://avatars.githubusercontent.com/u/3487289?v=4" />craigsapp</a> commented <strong> 8 months ago</strong> </div> <div class="markdown-body"> <p>Related to issue <a href="https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/549">https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/549</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>