humdrum-tools / verovio-humdrum-viewer

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

Suppress hiding empty staves #891

Open jacekiwaszko1 opened 7 months ago

jacekiwaszko1 commented 7 months ago

Is there a feature, that would allow for displaying a full score without compression of empty staves? I couldn't find it.

This is related mostly to issue #759 (OMD not displaying when top staff is hidden), I guess though, it would be useful in other cases too.

Test data:

**kern  **kern  **kern
*staff3 *staff2 *staff1
*part3  *part2  *part1
*I"III  *I"II   *I"I
*I'III  *I'II   *I'I
*clefG2 *clefG2 *clefG2
*M4/4   *M4/4   *M4/4
=1  =1  =1
1c  1c  1r
=2  =2  =2
1c  1c  1r
=3  =3  =3
!!LO:TX:t=test global comment
1c  1c  1r
=4  =4  =4
1c  1c  1r
=5  =5  =5
1c  1c  1r
=6  =6  =6
1c  1c  1r
=7  =7  =7
!!!OMD: test OMD
1c  1c  1r
=8  =8  =8
1c  1c  1r
==  ==  ==
*-  *-  *-
!!!system-decoration: [s1],[(s2,s3)]

Current rendering:

image

Click for MEI current conversion ```xml </titleStmt> <pubStmt> <unpub>This MEI file was created by Verovio's Humdrum converter. When published, this unpub element should be removed, and the enclosing pubStmt element should be properly filled out.</unpub> </pubStmt> </fileDesc> <encodingDesc> <appInfo> <application isodate="2024-04-17T10:23:40" version="4.2.0-dev-3d89370-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <extMeta> <frames xmlns="http://www.humdrum.org/ns/humxml"> <metaFrame n="20" token="!!!OMD: test OMD" xml:id="L21"> <frameInfo> <startTime float="24" /> <frameType>reference</frameType> <referenceKey>OMD</referenceKey> <referenceValue>test OMD</referenceValue> </frameInfo> </metaFrame> <metaFrame n="27" token="!!!system-decoration: [s1],[(s2,s3)]" xml:id="L28"> <frameInfo> <startTime float="32" /> <frameType>reference</frameType> <referenceKey>system-decoration</referenceKey> <referenceValue>[s1],[(s2,s3)]</referenceValue> </frameInfo> </metaFrame> </frames> </extMeta> </meiHead> <music decls="#work1_encoded"> <body> <mdiv xml:id="mpbnbv1"> <score xml:id="sxep7yx"> <scoreDef xml:id="sy1zc9m" midi.bpm="400.000000"> <staffGrp xml:id="smef1fe" bar.thru="false"> <staffGrp xml:id="s1pfy9tc" bar.thru="false" symbol="bracket"> <staffDef xml:id="staffdef-L1F3" n="1" lines="5"> <label xml:id="label-L4F3">I</label> <labelAbbr xml:id="labelabbr-L5F3">I</labelAbbr> <clef xml:id="clef-L6F3" shape="G" line="2" /> <meterSig xml:id="metersig-L7F3" count="4" unit="4" /> </staffDef> </staffGrp> <staffGrp xml:id="sf7ui10" bar.thru="true" symbol="bracket"> <staffDef xml:id="staffdef-L1F2" n="2" lines="5"> <label xml:id="label-L4F2">II</label> <labelAbbr xml:id="labelabbr-L5F2">II</labelAbbr> <clef xml:id="clef-L6F2" shape="G" line="2" /> <meterSig xml:id="metersig-L7F2" count="4" unit="4" /> </staffDef> <staffDef xml:id="staffdef-L1F1" n="3" lines="5"> <label xml:id="label-L4F1">III</label> <labelAbbr xml:id="labelabbr-L5F1">III</labelAbbr> <clef xml:id="clef-L6F1" shape="G" line="2" /> <meterSig xml:id="metersig-L7F1" count="4" unit="4" /> </staffDef> </staffGrp> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="staff-L1F3" n="1"> <layer xml:id="layer-L1F3N1" n="1"> <mRest xml:id="mrest-L9F3" /> </layer> </staff> <staff xml:id="staff-L1F2" n="2"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L9F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L1F1" n="3"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L9F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L10" n="2"> <staff xml:id="staff-L10F3N1" n="1"> <layer xml:id="layer-L10F3N1" n="1"> <mRest xml:id="mrest-L11F3" /> </layer> </staff> <staff xml:id="staff-L10F2N1" n="2"> <layer xml:id="layer-L10F2N1" n="1"> <note xml:id="note-L11F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L10F1N1" n="3"> <layer xml:id="layer-L10F1N1" n="1"> <note xml:id="note-L11F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L12" n="3"> <staff xml:id="staff-L12F3N1" n="1"> <layer xml:id="layer-L12F3N1" n="1"> <mRest xml:id="mrest-L13F3" /> </layer> </staff> <staff xml:id="staff-L12F2N1" n="2"> <layer xml:id="layer-L12F2N1" n="1"> <note xml:id="note-L13F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L12F1N1" n="3"> <layer xml:id="layer-L12F1N1" n="1"> <note xml:id="note-L13F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L14" n="4"> <staff xml:id="staff-L14F3N1" n="1"> <layer xml:id="layer-L14F3N1" n="1"> <mRest xml:id="mrest-L15F3" /> </layer> </staff> <staff xml:id="staff-L14F2N1" n="2"> <layer xml:id="layer-L14F2N1" n="1"> <note xml:id="note-L15F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L14F1N1" n="3"> <layer xml:id="layer-L14F1N1" n="1"> <note xml:id="note-L15F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L16" n="5"> <staff xml:id="staff-L16F3N1" n="1"> <layer xml:id="layer-L16F3N1" n="1"> <mRest xml:id="mrest-L17F3" /> </layer> </staff> <staff xml:id="staff-L16F2N1" n="2"> <layer xml:id="layer-L16F2N1" n="1"> <note xml:id="note-L17F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L16F1N1" n="3"> <layer xml:id="layer-L16F1N1" n="1"> <note xml:id="note-L17F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L18" n="6"> <staff xml:id="staff-L18F3N1" n="1"> <layer xml:id="layer-L18F3N1" n="1"> <mRest xml:id="mrest-L19F3" /> </layer> </staff> <staff xml:id="staff-L18F2N1" n="2"> <layer xml:id="layer-L18F2N1" n="1"> <note xml:id="note-L19F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L18F1N1" n="3"> <layer xml:id="layer-L18F1N1" n="1"> <note xml:id="note-L19F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L20" n="7"> <staff xml:id="staff-L20F3N1" n="1"> <layer xml:id="layer-L20F3N1" n="1"> <mRest xml:id="mrest-L22F3" /> </layer> </staff> <staff xml:id="staff-L20F2N1" n="2"> <layer xml:id="layer-L20F2N1" n="1"> <note xml:id="note-L22F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L20F1N1" n="3"> <layer xml:id="layer-L20F1N1" n="1"> <note xml:id="note-L22F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <tempo xml:id="tempo-L21F1" staff="1" tstamp="1.000000">test OMD</tempo> </measure> <measure xml:id="measure-L23" right="end" n="8"> <staff xml:id="staff-L23F3N1" n="1"> <layer xml:id="layer-L23F3N1" n="1"> <mRest xml:id="mrest-L25F3" /> </layer> </staff> <staff xml:id="staff-L23F2N1" n="2"> <layer xml:id="layer-L23F2N1" n="1"> <note xml:id="note-L25F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L23F1N1" n="3"> <layer xml:id="layer-L23F1N1" n="1"> <note xml:id="note-L25F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L24F1" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r17zi3y2" fontstyle="normal">test global comment</rend> </dir> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>I know from <a rel="noreferrer nofollow" target="_blank" href="https://github.com/rism-digital/verovio/issues/914">verovio/#914</a>, that in MEI it's possible to switch off hiding empty staves by adding <code>@optiimize="false"</code> to <code><scoreDef></code> element:</p> <details><summary>Click for modified MEI encoding</summary> ``` <?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> <unpub>This MEI file was created by Verovio's Humdrum converter. When published, this unpub element should be removed, and the enclosing pubStmt element should be properly filled out.</unpub> </pubStmt> </fileDesc> <encodingDesc> <appInfo> <application isodate="2024-04-17T10:23:40" version="4.2.0-dev-3d89370-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <extMeta> <frames xmlns="http://www.humdrum.org/ns/humxml"> <metaFrame n="20" token="!!!OMD: test OMD" xml:id="L21"> <frameInfo> <startTime float="24" /> <frameType>reference</frameType> <referenceKey>OMD</referenceKey> <referenceValue>test OMD</referenceValue> </frameInfo> </metaFrame> <metaFrame n="27" token="!!!system-decoration: [s1],[(s2,s3)]" xml:id="L28"> <frameInfo> <startTime float="32" /> <frameType>reference</frameType> <referenceKey>system-decoration</referenceKey> <referenceValue>[s1],[(s2,s3)]</referenceValue> </frameInfo> </metaFrame> </frames> </extMeta> </meiHead> <music decls="#work1_encoded"> <body> <mdiv xml:id="mpbnbv1"> <score xml:id="sxep7yx"> <scoreDef xml:id="sy1zc9m" midi.bpm="400.000000" optimize="false"> <staffGrp xml:id="smef1fe" bar.thru="false"> <staffGrp xml:id="s1pfy9tc" bar.thru="false" symbol="bracket"> <staffDef xml:id="staffdef-L1F3" n="1" lines="5"> <label xml:id="label-L4F3">I</label> <labelAbbr xml:id="labelabbr-L5F3">I</labelAbbr> <clef xml:id="clef-L6F3" shape="G" line="2" /> <meterSig xml:id="metersig-L7F3" count="4" unit="4" /> </staffDef> </staffGrp> <staffGrp xml:id="sf7ui10" bar.thru="true" symbol="bracket"> <staffDef xml:id="staffdef-L1F2" n="2" lines="5"> <label xml:id="label-L4F2">II</label> <labelAbbr xml:id="labelabbr-L5F2">II</labelAbbr> <clef xml:id="clef-L6F2" shape="G" line="2" /> <meterSig xml:id="metersig-L7F2" count="4" unit="4" /> </staffDef> <staffDef xml:id="staffdef-L1F1" n="3" lines="5"> <label xml:id="label-L4F1">III</label> <labelAbbr xml:id="labelabbr-L5F1">III</labelAbbr> <clef xml:id="clef-L6F1" shape="G" line="2" /> <meterSig xml:id="metersig-L7F1" count="4" unit="4" /> </staffDef> </staffGrp> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="staff-L1F3" n="1"> <layer xml:id="layer-L1F3N1" n="1"> <mRest xml:id="mrest-L9F3" /> </layer> </staff> <staff xml:id="staff-L1F2" n="2"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L9F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L1F1" n="3"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L9F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L10" n="2"> <staff xml:id="staff-L10F3N1" n="1"> <layer xml:id="layer-L10F3N1" n="1"> <mRest xml:id="mrest-L11F3" /> </layer> </staff> <staff xml:id="staff-L10F2N1" n="2"> <layer xml:id="layer-L10F2N1" n="1"> <note xml:id="note-L11F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L10F1N1" n="3"> <layer xml:id="layer-L10F1N1" n="1"> <note xml:id="note-L11F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L12" n="3"> <staff xml:id="staff-L12F3N1" n="1"> <layer xml:id="layer-L12F3N1" n="1"> <mRest xml:id="mrest-L13F3" /> </layer> </staff> <staff xml:id="staff-L12F2N1" n="2"> <layer xml:id="layer-L12F2N1" n="1"> <note xml:id="note-L13F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L12F1N1" n="3"> <layer xml:id="layer-L12F1N1" n="1"> <note xml:id="note-L13F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L14" n="4"> <staff xml:id="staff-L14F3N1" n="1"> <layer xml:id="layer-L14F3N1" n="1"> <mRest xml:id="mrest-L15F3" /> </layer> </staff> <staff xml:id="staff-L14F2N1" n="2"> <layer xml:id="layer-L14F2N1" n="1"> <note xml:id="note-L15F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L14F1N1" n="3"> <layer xml:id="layer-L14F1N1" n="1"> <note xml:id="note-L15F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L16" n="5"> <staff xml:id="staff-L16F3N1" n="1"> <layer xml:id="layer-L16F3N1" n="1"> <mRest xml:id="mrest-L17F3" /> </layer> </staff> <staff xml:id="staff-L16F2N1" n="2"> <layer xml:id="layer-L16F2N1" n="1"> <note xml:id="note-L17F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L16F1N1" n="3"> <layer xml:id="layer-L16F1N1" n="1"> <note xml:id="note-L17F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L18" n="6"> <staff xml:id="staff-L18F3N1" n="1"> <layer xml:id="layer-L18F3N1" n="1"> <mRest xml:id="mrest-L19F3" /> </layer> </staff> <staff xml:id="staff-L18F2N1" n="2"> <layer xml:id="layer-L18F2N1" n="1"> <note xml:id="note-L19F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L18F1N1" n="3"> <layer xml:id="layer-L18F1N1" n="1"> <note xml:id="note-L19F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> </measure> <measure xml:id="measure-L20" n="7"> <staff xml:id="staff-L20F3N1" n="1"> <layer xml:id="layer-L20F3N1" n="1"> <mRest xml:id="mrest-L22F3" /> </layer> </staff> <staff xml:id="staff-L20F2N1" n="2"> <layer xml:id="layer-L20F2N1" n="1"> <note xml:id="note-L22F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L20F1N1" n="3"> <layer xml:id="layer-L20F1N1" n="1"> <note xml:id="note-L22F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <tempo xml:id="tempo-L21F1" staff="1" tstamp="1.000000">test OMD</tempo> </measure> <measure xml:id="measure-L23" right="end" n="8"> <staff xml:id="staff-L23F3N1" n="1"> <layer xml:id="layer-L23F3N1" n="1"> <mRest xml:id="mrest-L25F3" /> </layer> </staff> <staff xml:id="staff-L23F2N1" n="2"> <layer xml:id="layer-L23F2N1" n="1"> <note xml:id="note-L25F2" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <staff xml:id="staff-L23F1N1" n="3"> <layer xml:id="layer-L23F1N1" n="1"> <note xml:id="note-L25F1" dur="1" oct="4" pname="c" accid.ges="n" /> </layer> </staff> <dir xml:id="dir-L24F1" place="above" staff="1" tstamp="1.000000"> <rend xml:id="r17zi3y2" fontstyle="normal">test global comment</rend> </dir> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Full score rendering: </p> <p><img referrerpolicy="no-referrer" src="https://github.com/humdrum-tools/verovio-humdrum-viewer/assets/29225574/22038a06-d468-4337-9a68-94c51da0df35" alt="image" /></p> <p>If there's no way to do that yet in Humdrum, maybe reference record, similar to <code>!!!system-decoration:</code> could be added? Maybe <code>!!!score-optimization:</code> with boolean values (<code>true</code>/<code>false</code>)?</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> 7 months ago</strong> </div> <div class="markdown-body"> <p>Yes, you can add an explicit verovio record to turn off the "condense" option:</p> <pre><code class="language-tsv">!!!verovio: condense none</code></pre> <img width="1076" alt="Screenshot 2024-04-17 at 2 07 58 AM" src="https://github.com/humdrum-tools/verovio-humdrum-viewer/assets/3487289/3f760d5b-50a0-41fc-8fc7-994c016163e3"> <p>That option can be left in the data if the score should not condense resting parts on a system.</p> <p>Ideally verovio should not condense the resting part if it has text (<code><dir></code>).</p> <p>Also in this case, the global text should appear at the system level (above the highest visible staff). But that is not in my control: verovio decides when to remove a staff, which will depend on the layout of system breaks. Also MEI does not have a concept of system text that is needed here (I attach Humdrum system-level text to the top staff in the MEI conversion). I will see about starting a discussion about that in the music-encoding repository.</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> 7 months ago</strong> </div> <div class="markdown-body"> <p>A related item: I currently only display system-level text at the top of the system (or bottom). For orchestral scores, the system-level text is repeated for each barred group of staves:</p> <img width="558" alt="Screenshot 2024-04-17 at 2 32 32 AM" src="https://github.com/humdrum-tools/verovio-humdrum-viewer/assets/3487289/4b003806-ec00-4841-80a9-53da8825f90e"> <p>But not every group as in the above case (only the top of the score and above the string group).</p> <p>Maybe encode this information in the sytem-decoration record, where s, p, g, can be given as S, P, G to indicate that system-level text should be repeated on the given staff/part/group.</p> <p>In this case:</p> <pre><code class="language-tsv">!!!system-decoration: [(g1)][(g2)]g3[(G4)]</code></pre> <p>where </p> <ul> <li>g1 = woodwinds (by default the first group will include the system level text, so capitalization is not necessary).</li> <li>g2 = brass</li> <li>g3 = timpani</li> <li>G4 = strings (where system-level text should be added at top of group)</li> </ul> </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>