humdrum-tools / verovio-humdrum-viewer

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

Add score/part titles #730

Closed craigsapp closed 2 years ago

craigsapp commented 2 years ago

When a score staff shares multiple parts, allow for a joined name and individual name.

Here is an example:

Screen Shot 2022-05-16 at 12 35 42 PM

Currently the name for the staff is searched until the first data line is found, and the title is searched after *^. Make any spine manipulator also stop the search for a staff name so that "Oboi" would be used in this case.

Test data:

**kern
*oboe
*I"Oboi
*I'obs.
*clefG2
*M4/4
*^
*I"Oboe 1   *I"Oboe2
*I'ob1  *I'ob2
*join   *join
=1  =1
4cc 4g
2b  4a
.   4f
8ccL    8aL
8ddJ    8gJ
=   =
*v  *v
*-

Extracting parts works, since the last *I" and *I' are used, and there is no spine manipulator to stop the search for the secondary labels:

Screen Shot 2022-05-16 at 12 38 12 PM

Here is the compiled filter extract -e | extract -r:

**kern  **kern
*oboe   *oboe
*I"Oboi *I"Oboi
*I"obs. *I"obs.
*clefG2 *clefG2
*M4/4   *M4/4
*   *
*I"Oboe2    *I"Oboe 1
*I'ob2  *I'ob1
*join   *join
=1  =1
4g  4cc
4a  2b
4f  .
8aL 8ccL
8gJ 8ddJ
=   =
*   *
*-  *-
craigsapp commented 2 years ago

Implemented with commit https://github.com/rism-digital/verovio/commit/62baa906ce9de273e9e6c7e5b57d8d8347bade84

Example:

**kern
*oboe
*I"Oboi
*I'obs.
*clefG2
*M4/4
*^
*I"Oboe 1   *I"Oboe2
*I'ob1  *I'ob2
*join   *join
=1  =1
4cc 4g
2b  4a
.   4f
8ccL    8aL
8ddJ    8gJ
=   =
*v  *v
*-

Now renders as:

Screen Shot 2022-05-16 at 9 26 16 PM
Click to view MEI translation of above Humdrum data ```xml </titleStmt> <pubStmt /> </fileDesc> <encodingDesc> <appInfo> <application isodate="2022-05-16T21:26:46" version="3.10.0-dev-a715cd1"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="myui403"> <score xml:id="ssvqh7j"> <scoreDef xml:id="smddlp8"> <staffGrp xml:id="s8cmqs8"> <staffDef xml:id="sfrrkew" n="1" lines="5"> <label xml:id="label-L3F1">Oboi</label> <clef xml:id="clef-L5F1" shape="G" line="2" /> <meterSig xml:id="metersig-L6F1" count="4" unit="4" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="sojedgi" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L12F1" dur="4" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L13F1" dur="2" oct="4" pname="b" accid.ges="n" /> <beam xml:id="beam-L15F1-L16F1"> <note xml:id="note-L15F1" dur="8" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L16F1" dur="8" oct="5" pname="d" accid.ges="n" /> </beam> </layer> <layer xml:id="layer-L1F1N2" n="2"> <note xml:id="note-L12F2" dur="4" oct="4" pname="g" stem.sameas="#note-L12F1" accid.ges="n" /> <note xml:id="note-L13F2" dur="4" oct="4" pname="a" accid.ges="n" /> <note xml:id="note-L14F2" dur="4" oct="4" pname="f" accid.ges="n" /> <beam xml:id="beam-L15F2-L16F2"> <note xml:id="note-L15F2" dur="8" oct="4" pname="a" stem.sameas="#note-L15F1" accid.ges="n" /> <note xml:id="note-L16F2" dur="8" oct="4" pname="g" stem.sameas="#note-L16F1" accid.ges="n" /> </beam> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>Extracting individual parts:</p> <pre><code class="language-tsv">!!!filter: flipper -a | extract -e **kern *oboe *I"Oboi *I'obs. *clefG2 *M4/4 *^ *I"Oboe 1 *I"Oboe2 *I'ob1 *I'ob2 *join *join =1 =1 4cc 4g 2b 4a . 4f 8ccL 8aL 8ddJ 8gJ = = *v *v *-</code></pre> <p>compiles to:</p> <pre><code class="language-tsv">**kern **kern *oboe *oboe *I"Oboi *I"Oboi *I'obs. *I'obs. *clefG2 *clefG2 *M4/4 *M4/4 * * *I"Oboe2 *I"Oboe 1 *I'ob2 *I'ob1 *join *join =1 =1 4g 4cc 4a 2b 4f . 8aL 8ccL 8gJ 8ddJ = = * * *- *-</code></pre> <p>Which renders as:</p> <img width="456" alt="Screen Shot 2022-05-16 at 9 30 14 PM" src="https://user-images.githubusercontent.com/3487289/168729279-4a73c5f6-dc85-4c65-9154-78c762f86a20.png"> <details> <summary> Click to view MEI data of above Humdrum data </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-05-16T21:30:53" version="3.10.0-dev-a715cd1"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="mgq85t7"> <score xml:id="sfwfwl5"> <scoreDef xml:id="swjsfmb"> <staffGrp xml:id="s6ep7p1" bar.thru="true" symbol="brace"> <staffDef xml:id="sips5za" n="1" lines="5"> <label xml:id="label-L8F2">Oboe 1</label> <labelAbbr xml:id="labelabbr-L9F2">ob1</labelAbbr> <clef xml:id="clef-L5F2" shape="G" line="2" /> <meterSig xml:id="metersig-L6F2" count="4" unit="4" /> </staffDef> <staffDef xml:id="si0bnyp" n="2" lines="5"> <label xml:id="label-L8F1">Oboe2</label> <labelAbbr xml:id="labelabbr-L9F1">ob2</labelAbbr> <clef xml:id="clef-L5F1" shape="G" line="2" /> <meterSig xml:id="metersig-L6F1" count="4" unit="4" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="sbnd881" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <note xml:id="note-L12F2" dur="4" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L13F2" dur="2" oct="4" pname="b" accid.ges="n" /> <beam xml:id="beam-L15F2-L16F2"> <note xml:id="note-L15F2" dur="8" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L16F2" dur="8" oct="5" pname="d" accid.ges="n" /> </beam> </layer> </staff> <staff xml:id="sp6ew5r" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L12F1" dur="4" oct="4" pname="g" accid.ges="n" /> <note xml:id="note-L13F1" dur="4" oct="4" pname="a" accid.ges="n" /> <note xml:id="note-L14F1" dur="4" oct="4" pname="f" accid.ges="n" /> <beam xml:id="beam-L15F1-L16F1"> <note xml:id="note-L15F1" dur="8" oct="4" pname="a" accid.ges="n" /> <note xml:id="note-L16F1" dur="8" oct="4" pname="g" accid.ges="n" /> </beam> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <hr /> <p>Extracting first oboe part:</p> <pre><code class="language-bash">flipper -a | extract -e | extract -k 2 | rid -glid</code></pre> <p>Creates this file:</p> <pre><code class="language-tsv">**kern *oboe *I"Oboi *I'obs. *clefG2 *M4/4 *I"Oboe 1 *I'ob1 *join =1 4cc 2b 8ccL 8ddJ = *-</code></pre> <p>Rendering as:</p> <img width="335" alt="Screen Shot 2022-05-16 at 9 34 55 PM" src="https://user-images.githubusercontent.com/3487289/168729773-63d24857-4031-4252-8fb9-bf4855008b83.png"> <details> <summary> Click to view MEI conversion of above Humdrum data </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-05-16T21:35:18" version="3.10.0-dev-a715cd1"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> <workList> <work> <title /> </work> </workList> </meiHead> <music> <body> <mdiv xml:id="mbo1szr"> <score xml:id="so9fdpe"> <scoreDef xml:id="sgakpon"> <staffGrp xml:id="sfonhgn"> <staffDef xml:id="sjkpbpk" n="1" lines="5"> <label xml:id="label-L7F1">Oboe 1</label> <clef xml:id="clef-L5F1" shape="G" line="2" /> <meterSig xml:id="metersig-L6F1" count="4" unit="4" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="1"> <staff xml:id="sgzqzlc" n="1"> <layer xml:id="layer-L1F1N1" n="1"> <note xml:id="note-L11F1" dur="4" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L12F1" dur="2" oct="4" pname="b" accid.ges="n" /> <beam xml:id="beam-L13F1-L14F1"> <note xml:id="note-L13F1" dur="8" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L14F1" dur="8" oct="5" pname="d" accid.ges="n" /> </beam> </layer> </staff> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> </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>