humdrum-tools / verovio-humdrum-viewer

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

Rest overfilling behavior #655

Closed craigsapp closed 2 years ago

craigsapp commented 2 years ago

for @WolfgangDrescher, and also of interest for @jacekiwaszko1 and @mkonik:

This example from issue https://github.com/rism-digital/verovio/issues/2690, and a minimal extract of https://verovio.humdrum.org/?github=WolfgangDrescher/lassus-geistliche-psalmen/kern/01-beatus-vir.krn:

**kern  **kern
*clefC2 *clefG2
*k[]    *k[]
*M2/1   *M2/1
*met(C|)    *met(C|)
=1  =1
00r 1dd
.   2dd
.   2dd
=2  =2
.   1b
.   2cc
.   2a
=   =
*-  *-
Screen Shot 2022-03-04 at 11 28 19 PM

The rest in the first measure should be shown as a long rest rather than a breve rest. The basic problem is that <mRest>, which is being used in the first measure when converting to MEI, cannot yet have a duration or visual duration in verovio:

 <mRest xml:id="mrest-L7F1" dur="long" dur.ges="breve" />
Click to view MEI conversion for example (with handed edited values for `mRest@dur` and `mRest@dur.ges`) ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2022-03-04T23:31:46" 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="m2efzb"> <score xml:id="s9ebhpa"> <scoreDef xml:id="sfjz8wz" midi.bpm="400.000000"> <staffGrp xml:id="syk24b4" bar.thru="true" symbol="brace"> <staffDef xml:id="s4i9htl" n="1" lines="5"> <clef xml:id="clef-L2F2" shape="G" line="2" /> <keySig xml:id="keysig-L3F2" sig="0" /> <meterSig xml:id="metersig-L4F2" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F2" sign="C" slash="1" /> </staffDef> <staffDef xml:id="s7v4pcg" n="2" lines="5"> <clef xml:id="clef-L2F1" shape="C" line="2" /> <keySig xml:id="keysig-L3F1" sig="0" /> <meterSig xml:id="metersig-L4F1" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F1" sign="C" slash="1" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="s5ll42" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L7F2" dur="1" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L8F2" dur="2" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L9F2" dur="2" oct="5" pname="d" accid.ges="n" /> </layer> </staff> <staff xml:id="s2z00fa" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <mRest xml:id="mrest-L7F1" dur="long" dur.ges="breve" /> </layer> </staff> </measure> <measure xml:id="measure-L10" n="2"> <staff xml:id="staff-L10F2N1" n="1"> <layer xml:id="layer-L10F2N1" n="1"> <note xml:id="note-L11F2" dur="1" oct="4" pname="b" accid.ges="n" /> <note xml:id="note-L12F2" dur="2" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L13F2" dur="2" oct="4" pname="a" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L10F1N1" n="2"> <layer xml:id="layer-L10F1N1" n="1"> <space xml:id="shlcfkk" dur="1" /> <space xml:id="s5yfa9y" dur="1" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>But in any case, I think that <code><mRest></code> should not be used in this situation, and rather <code><rest></code> should be used. This will allow displaying of a long rest that is left justified (rather than center justified with mRests):</p> <img width="656" alt="Screen Shot 2022-03-04 at 11 44 01 PM" src="https://user-images.githubusercontent.com/3487289/156873877-08510a8f-2558-467a-b2b0-87f4fc2d748d.png"> <p>Another possibility for visual display is splitting the rest into two:</p> <img width="667" alt="Screen Shot 2022-03-04 at 11 46 17 PM" src="https://user-images.githubusercontent.com/3487289/156873937-e59d06a1-da32-4c9d-8e24-cf52a52d54a9.png"> <p>I think that this should not be the expected default rendering, but a filter/tool could be developed to convert the long-rest version to the two breve-rest version.</p> <p>And interesting concept could be to allow encoding or transforming the long rest like this:</p> <img width="926" alt="Screen Shot 2022-03-04 at 11 50 23 PM" src="https://user-images.githubusercontent.com/3487289/156874102-aa854b08-b073-4f4a-ab61-ad6140ffe0a0.png"> <p>where the two rests are "tied" together. This would allow for the <code>tie -m</code> filter to merge the independent rests into a single rest:</p> <img width="934" alt="Screen Shot 2022-03-04 at 11 51 54 PM" src="https://user-images.githubusercontent.com/3487289/156874165-26804456-f9f3-48ca-abaf-d3b41fad4a5a.png"> <p>(the rest should display as a long rest left justified in the first measure).</p> <p>Then there would be some option added to the tie tool that would be able to split the long rest into two tied breve rests (the ties on rest would not be translated into MEI, but would be used to split and merge such rests automatically. This would also help in preparing fully modern score from diplomatic encodings.</p> <hr /> <p>A subissue is that the overflow duration from the long rest in the second measure is being split into two separate <code><space></code> elements:</p> <pre><code class="language-xml"> <space xml:id="shlcfkk" dur="1" /> <space xml:id="s5yfa9y" dur="1" /></code></pre> <p>These should be merged into one breve space:</p> <pre><code class="language-xml"> <space xml:id="shlcfkk" dur="breve" /></code></pre> <p>Also extend to "long" (no "maxima" durations in MEI cmn module, so longs cannot be merged into maximas).</p> <hr /> <p>Another subissue is that the clipped rest and following invisible rests should be given a <code>@type="straddle"</code> (or similar) so that the MEI conversion can identify this sort of case. This is related to issue <a rel="noreferrer nofollow" target="_blank" href="https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/652">https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/652</a></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>Commit <a href="https://github.com/rism-digital/verovio/commit/78c69b1223697e50cd237422c3b7daa079863e98">https://github.com/rism-digital/verovio/commit/78c69b1223697e50cd237422c3b7daa079863e98</a> allows for breve and long durations for <code><spaces></code>. Now the example data has a single <code><space></code> for the breve-duration measure:</p> <pre><code class="language-xml"> <space xml:id="sdmc3pe" dur="breve" /></code></pre> <details> <summary> Click to view new MEI conversion </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-05T08:48:21" 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="mh9ktaj"> <score xml:id="stezj6f"> <scoreDef xml:id="soqwza9" midi.bpm="400.000000"> <staffGrp xml:id="snxpnzc" bar.thru="true" symbol="brace"> <staffDef xml:id="sff0kmz" n="1" lines="5"> <clef xml:id="clef-L2F2" shape="G" line="2" /> <keySig xml:id="keysig-L3F2" sig="0" /> <meterSig xml:id="metersig-L4F2" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F2" sign="C" slash="1" /> </staffDef> <staffDef xml:id="snawhfx" n="2" lines="5"> <clef xml:id="clef-L2F1" shape="C" line="2" /> <keySig xml:id="keysig-L3F1" sig="0" /> <meterSig xml:id="metersig-L4F1" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F1" sign="C" slash="1" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="s4f2n72" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L7F2" dur="1" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L8F2" dur="2" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L9F2" dur="2" oct="5" pname="d" accid.ges="n" /> </layer> </staff> <staff xml:id="s2e9ze5" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <mRest xml:id="mrest-L7F1" /> </layer> </staff> </measure> <measure xml:id="measure-L10" n="2"> <staff xml:id="staff-L10F2N1" n="1"> <layer xml:id="layer-L10F2N1" n="1"> <note xml:id="note-L11F2" dur="1" oct="4" pname="b" accid.ges="n" /> <note xml:id="note-L12F2" dur="2" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L13F2" dur="2" oct="4" pname="a" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L10F1N1" n="2"> <layer xml:id="layer-L10F1N1" n="1"> <space xml:id="sdmc3pe" dur="breve" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </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>Implemented with commit <a href="https://github.com/rism-digital/verovio/commit/382f16c2e0fb9c66fcd134683521592e2008fdfd">https://github.com/rism-digital/verovio/commit/382f16c2e0fb9c66fcd134683521592e2008fdfd</a></p> <p>Updated example:</p> <pre><code class="language-tsv">**kern **kern *clefC2 *clefG2 *k[] *k[] *M2/1 *M2/1 *met(C|) *met(C|) =1 =1 00r 1dd . 2dd . 2dd =2 =2 . 1b . 2cc . 2a = = *- *-</code></pre> <p>Now renders as:</p> <img width="650" alt="Screen Shot 2022-03-05 at 12 33 11 PM" src="https://user-images.githubusercontent.com/3487289/156899168-6c33281c-6428-4d6b-b434-d95c9634017e.png"> <details> <summary> Click to view MEI translation </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-05T12:15:09" 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="mq8aw0k"> <score xml:id="s4s8h6x"> <scoreDef xml:id="s32c9tj" midi.bpm="400.000000"> <staffGrp xml:id="sbtzd34" bar.thru="true" symbol="brace"> <staffDef xml:id="shpjd7k" n="1" lines="5"> <clef xml:id="clef-L2F2" shape="G" line="2" /> <keySig xml:id="keysig-L3F2" sig="0" /> <meterSig xml:id="metersig-L4F2" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F2" sign="C" slash="1" /> </staffDef> <staffDef xml:id="sp2g1ah" n="2" lines="5"> <clef xml:id="clef-L2F1" shape="C" line="2" /> <keySig xml:id="keysig-L3F1" sig="0" /> <meterSig xml:id="metersig-L4F1" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F1" sign="C" slash="1" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="sj1toj7" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L7F2" dur="1" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L8F2" dur="2" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L9F2" dur="2" oct="5" pname="d" accid.ges="n" /> </layer> </staff> <staff xml:id="scyxge4" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <rest xml:id="ri541dy" type="straddle" dur.ges="breve" dur="long" /> </layer> </staff> </measure> <measure xml:id="measure-L10" n="2"> <staff xml:id="staff-L10F2N1" n="1"> <layer xml:id="layer-L10F2N1" n="1"> <note xml:id="note-L11F2" dur="1" oct="4" pname="b" accid.ges="n" /> <note xml:id="note-L12F2" dur="2" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L13F2" dur="2" oct="4" pname="a" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L10F1N1" n="2"> <layer xml:id="layer-L10F1N1" n="1"> <space xml:id="syh3b0x" type="straddle" dur="breve" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <hr /> <p>Normal rests still work as before (using <code><mRest></code>):</p> <pre><code class="language-tsv">**kern **kern *clefC2 *clefG2 *k[] *k[] *M2/1 *M2/1 *met(C|) *met(C|) =1 =1 0r 1dd . 2dd . 2dd =2 =2 0r 1b . 2cc . 2a = = *- *-</code></pre> <img width="641" alt="Screen Shot 2022-03-05 at 12 37 54 PM" src="https://user-images.githubusercontent.com/3487289/156899284-3d8841a6-54c6-4a35-a2d7-bff1dc8aed4e.png"> <details> <summary> Click to view MEI conversion of 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-05T12:40:01" 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="mz9jht8"> <score xml:id="shoj4mc"> <scoreDef xml:id="sdxkpbf" midi.bpm="400.000000"> <staffGrp xml:id="si587hy" bar.thru="true" symbol="brace"> <staffDef xml:id="s6lhh1j" n="1" lines="5"> <clef xml:id="clef-L2F2" shape="G" line="2" /> <keySig xml:id="keysig-L3F2" sig="0" /> <meterSig xml:id="metersig-L4F2" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F2" sign="C" slash="1" /> </staffDef> <staffDef xml:id="snofvw" n="2" lines="5"> <clef xml:id="clef-L2F1" shape="C" line="2" /> <keySig xml:id="keysig-L3F1" sig="0" /> <meterSig xml:id="metersig-L4F1" count="2" unit="1" form="invis" /> <mensur xml:id="mensur-L5F1" sign="C" slash="1" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="sfdsz8f" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L7F2" dur="1" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L8F2" dur="2" oct="5" pname="d" accid.ges="n" /> <note xml:id="note-L9F2" dur="2" oct="5" pname="d" accid.ges="n" /> </layer> </staff> <staff xml:id="sx0lqw8" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <mRest xml:id="mrest-L7F1" /> </layer> </staff> </measure> <measure xml:id="measure-L10" n="2"> <staff xml:id="staff-L10F2N1" n="1"> <layer xml:id="layer-L10F2N1" n="1"> <note xml:id="note-L11F2" dur="1" oct="4" pname="b" accid.ges="n" /> <note xml:id="note-L12F2" dur="2" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L13F2" dur="2" oct="4" pname="a" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L10F1N1" n="2"> <layer xml:id="layer-L10F1N1" n="1"> <mRest xml:id="mrest-L11F1" /> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <hr /> <p>Here is the rest+tie encoding method example:</p> <pre><code class="language-tsv">**kern **kern *clefC2 *clefG2 *k[] *k[] *M2/1 *M2/1 *met(C|) *met(C|) =1 =1 [0r 1dd . 2dd . 2dd =2 =2 0r] 1b . 2cc . 2a = = *- *- !!!filter: tie -m</code></pre> <img width="539" alt="Screen Shot 2022-03-05 at 12 44 30 PM" src="https://user-images.githubusercontent.com/3487289/156899448-59d62ce9-8a9d-4313-b928-1363cc80271a.png"> <p>An option should be added to the <code>tie</code> filter to allow only merging/breaking rests.</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 the original test composition:</p> <img width="1645" alt="Screen Shot 2022-03-05 at 1 04 59 PM" src="https://user-images.githubusercontent.com/3487289/156899988-886a83d6-ac11-44f8-858f-5ddb963a1bbb.png"> <p>Measure 1 & 2 in the Tenor part now has better (and correct) notation.</p> <p>Also I added the verovio options:</p> <pre><code>!!!verovio: spacingLinear .1 !!!verovio: spacingNonLinear .1</code></pre> <p>This is similar to </p> <pre><code>!!!verovio: evenNoteSpacing 1</code></pre> <p>But allows more control of the spacing (giving a little more space than <code>evenNoteSpacing</code> does, which is equivalent to <code>spacingLinear 0</code> and <code>spacingNonLinear 0</code>).</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/WolfgangDrescher"><img src="https://avatars.githubusercontent.com/u/865594?v=4" />WolfgangDrescher</a> commented <strong> 2 years ago</strong> </div> <div class="markdown-body"> <p>Perfect! Thank you for implementing this so fast. And again thanks for all the help and hints to the options I get to know here.</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>