humdrum-tools / verovio-humdrum-viewer

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

Partial barlines #237

Closed jacekiwaszko1 closed 4 years ago

jacekiwaszko1 commented 5 years ago

In the following example from Chopin's Waltz op. 34 no. 1 (Schlesinger, Paris) there's no barline in top staff:

partial-barline-orig

I think the best way of encoding that in Humdrum format would be to join those measures into one double measure and add fake barline in the bottom staff:

**kern  **kern  **dynam
*staff2 *staff1 *
*clefF4 *clefG2 *
*k[b-e-a-d-]    *k[b-e-a-d-]    *
*M3/4   *M3/4   *
=68 =68 =68
*ped    *   *
4AA-    2a-M>\  .
4c 4A- 4E-  .   .
*   *Xtuplet    *
*   *cue    *
4g 4c 4A-   (>52%3gn\L  .
.   52%3a-\ .
.   52%3b-\ .
*Xped   *   *
.   52%3cc\ .
.   52%3dd-\    .
*ped    *   *
!LO:barline:partial !   !
4D- .   .
.   52%3ee-\    .
.   52%3ff\ .
.   52%3gg-X\   .
.   52%3aa-\    .
4d- 4A- 4F  .   .
.   52%3bb-\    .
.   52%3ccc\    .
.   52%3ddd-\   .
.   52%3eee-\J) .
*   *tuplet *
*   *Xcue   *
*Xped   *   *
4f 4d- 4A-  4fff`>  .
=70 =70 =70
*-  *-  *-

I've marked the place with partial barline as !LO:barline:partial, but maybe !LO:M:PB (where M is for Measure and PB for Partial Barline) would be more consistant with other layout commands.

Either way it probably should be converted as <barLine/> to MEI (if it is not illegal to use this element in non-mensural context?)

Target rendering:

partial-barLine-targ

Target MEI conversion:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
    <meiHead>
        <fileDesc>
            <titleStmt>
                <title />
            </titleStmt>
            <pubStmt />
        </fileDesc>
        <encodingDesc>
            <appInfo>
                <application isodate="2019-08-05T14:34:30" version="2.2.0-dev-724637b">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000002095486257">
                <score xml:id="score-0000000283977929">
                    <scoreDef xml:id="scoredef-0000001362071182">
                        <staffGrp xml:id="staffgrp-0000001133498563" symbol="brace" bar.thru="true">
                            <labelAbbr xml:id="labelAbbr-0000001019739478" />
                            <staffDef xml:id="staffdef-0000001493378313" clef.shape="G" clef.line="2" key.sig="4f" meter.count="3" meter.unit="4" n="1" lines="5" />
                            <staffDef xml:id="staffdef-0000001602133389" clef.shape="F" clef.line="4" key.sig="4f" meter.count="3" meter.unit="4" n="2" lines="5" />
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1" n="0">
                            <staff xml:id="staff-0000001952878327" n="1">
                                <layer xml:id="layer-L1F2N1" n="1">
                                    <note xml:id="note-L8F2" dur="2" oct="4" pname="a" stem.dir="down" accid.ges="f" />
                                    <tuplet xml:id="tuplet-L12F2-L28F2" num="13" numbase="12" num.visible="false" bracket.visible="false" num.format="count">
                                        <beam xml:id="beam-L12F2-L28F2">
                                            <note xml:id="note-L12F2" dur="16" oct="4" pname="g" cue="true" stem.dir="down">
                                                <accid xml:id="accid-L12F2" accid="n" func="caution" />
                                            </note>
                                            <note xml:id="note-L13F2" dur="16" oct="4" pname="a" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L14F2" dur="16" oct="4" pname="b" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L16F2" dur="16" oct="5" pname="c" cue="true" stem.dir="down" accid.ges="n" />
                                            <note xml:id="note-L17F2" dur="16" oct="5" pname="d" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L20F2" dur="16" oct="5" pname="e" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L21F2" dur="16" oct="5" pname="f" cue="true" stem.dir="down" accid.ges="n" />
                                            <note xml:id="note-L22F2" dur="16" oct="5" pname="g" cue="true" stem.dir="down" accid="f" />
                                            <note xml:id="note-L23F2" dur="16" oct="5" pname="a" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L25F2" dur="16" oct="5" pname="b" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L26F2" dur="16" oct="6" pname="c" cue="true" stem.dir="down" accid.ges="n" />
                                            <note xml:id="note-L27F2" dur="16" oct="6" pname="d" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L28F2" dur="16" oct="6" pname="e" cue="true" stem.dir="down" accid.ges="f" />
                                        </beam>
                                    </tuplet>
                                    <note xml:id="note-L32F2" dur="4" oct="6" pname="f" accid.ges="n">
                                        <artic xml:id="artic-L32F2" artic="stacciss" />
                                    </note>
                                </layer>
                            </staff>
                            <staff xml:id="staff-0000000653496056" n="2">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L8F1" dur="4" oct="2" pname="a" accid.ges="f" />
                                    <chord xml:id="chord-L9F1" dur="4">
                                        <note xml:id="note-L9F1S1" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L9F1S2" oct="3" pname="a" accid.ges="f" />
                                        <note xml:id="note-L9F1S3" oct="3" pname="e" accid.ges="f" />
                                    </chord>
                                    <chord xml:id="chord-L12F1" dur="4">
                                        <note xml:id="note-L12F1S1" oct="4" pname="g" accid.ges="n" />
                                        <note xml:id="note-L12F1S2" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L12F1S3" oct="3" pname="a" accid.ges="f" />
                                    </chord>
                                    <barLine/>
                                    <note xml:id="note-L19F1" dur="4" oct="3" pname="d" accid.ges="f" />
                                    <chord xml:id="chord-L24F1" dur="4">
                                        <note xml:id="note-L24F1S1" oct="4" pname="d" accid.ges="f" />
                                        <note xml:id="note-L24F1S2" oct="3" pname="a" accid.ges="f" />
                                        <note xml:id="note-L24F1S3" oct="3" pname="f" accid.ges="n" />
                                    </chord>
                                    <chord xml:id="chord-L32F1" dur="4">
                                        <note xml:id="note-L32F1S1" oct="4" pname="f" accid.ges="n" />
                                        <note xml:id="note-L32F1S2" oct="4" pname="d" accid.ges="f" />
                                        <note xml:id="note-L32F1S3" oct="3" pname="a" accid.ges="f" />
                                    </chord>
                                </layer>
                            </staff>
                            <mordent xml:id="mordent-L8F2" staff="1" startid="#note-L8F2" form="upper" />
                            <slur xml:id="slur-L12F2-L28F2" staff="1" startid="#note-L12F2" endid="#note-L28F2" />
                            <pedal xml:id="pedal-0000001718114590" staff="2" tstamp="1.000000" dir="down" vgrp="200" />
                            <pedal xml:id="pedal-0000001368448365" staff="2" tstamp="3.692308" dir="up" vgrp="200" />
                            <pedal xml:id="pedal-0000001600054592" staff="2" tstamp="4.000000" dir="down" vgrp="200" />
                            <pedal xml:id="pedal-0000001555686464" staff="2" tstamp="6.000000" dir="up" vgrp="200" />
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

BTW: I still can't figure out how to use *rscale with fractions as rhythm values. The idea proposed in https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/154#issuecomment-430873801 with !!!RDF**kern: Z = single beam, cue-sized seems like very handy solution for the problem.

craigsapp commented 5 years ago

This is a complicated case that will take thought... An alternative encoding would be to make the barline invisible in the middle of the top staff example, and then use a <beamSpan> element to connect the notes with a single beam across the measures.

However, verovio does not yet implment <beamSpan>, and I also think that it does not allow both <barline> and <measure> in the same score at the same time (<barline> is used mostly in mensural MEI encodings, for example).

In terms of a logical encoding, however, my proposal is better: the meter does not shift from 3/4 into 6/4, so the encoding should also remain in 3/4. But to convert into verovio, <beamSpan> would need to be implemented (there is another case where beamspans are needed, which I list in the new spreadsheet, so beamspans will be needed eventually).

jacekiwaszko1 commented 5 years ago

[...] and I also think that it does not allow both <barline> and <measure> in the same score at the same time (<barline> is used mostly in mensural MEI encodings, for example).

That is what I was affraid of...

In alternative encoding, however, I can't find the way to encode tuplet notes as equal. Is there a way to do that or do I have to encode quintuplets in first measure and sixteens in second?:

**kern  **kern  **dynam
*staff2 *staff1 *
*clefF4 *clefG2 *
*k[b-e-a-d-]    *k[b-e-a-d-]    *
*M3/4   *M3/4   *
=68 =68 =68
*ped    *   *
4AA-    2a-M>\  .
4c 4A- 4E-  .   .
*   *Xtuplet    *
*   *cue    *
*   *rscale:2   *
4g 4c 4A-   (>20gn\L    .
.   20a-\   .
.   20b-\   .
*Xped   *   *
.   20cc\   .
.   20dd-\J .
=69 =69-    =69
*ped    *   *
4D- 16ee-\L .
.   16ff\   .
.   16gg-X\ .
.   16aa-\  .
4d- 4A- 4F  16bb-\  .
.   16ccc\  .
.   16ddd-\ .
.   16eee-\J)   .
*   *tuplet *
*   *Xcue   *
*   *rscale:1   *
*Xped   *   *
4f 4d- 4A-  4fff`>  .
=70 =70 =70
*-  *-  *-
jacekiwaszko1 commented 5 years ago

Actually it came to me, that there's a way of encoding tuplet notes as equal - last note in m. 68 can cross the barline. That's however not the best idea (https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/150#issuecomment-426744851).

**kern  **kern  **dynam
*staff2 *staff1 *
*clefF4 *clefG2 *
*k[b-e-a-d-]    *k[b-e-a-d-]    *
*M3/4   *M3/4   *
=68 =68 =68
*ped    *   *
4AA-    2a-M>\  .
4c 4A- 4E-  .   .
*   *Xtuplet    *
*   *cue    *
4g 4c 4A-   (>52%3gn\L  .
.   52%3a-\ .
.   52%3b-\ .
*Xped   *   *
.   52%3cc\ .
.   52%3dd-\J   .
=69 =69 =69
*ped    *   *
4D- .   .
.   52%3ee-\L   .
.   52%3ff\ .
.   52%3gg-X\   .
.   52%3aa-\    .
4d- 4A- 4F  .   .
.   52%3bb-\    .
.   52%3ccc\    .
.   52%3ddd-\   .
.   52%3eee-\J) .
*   *tuplet *
*   *Xcue   *
*Xped   *   *
4f 4d- 4A-  4fff`>  .
=70 =70 =70
*-  *-  *-

This kind of encoding would require several major (I guess) changes in MEI, Humdrum Extras, humdrum-to-MEI converter and in Verovio to make it work.

Current rendering:

cross-measure-beam1

Notice that in MEI code there's <space> at the begining of measure 69 that has no dur attribute:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
    <meiHead>
        <fileDesc>
            <titleStmt>
                <title />
            </titleStmt>
            <pubStmt />
        </fileDesc>
        <encodingDesc>
            <appInfo>
                <application isodate="2019-08-06T10:35:37" version="2.2.0-dev-724637b-dirty">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000001007965779">
                <score xml:id="score-0000001785972836">
                    <scoreDef xml:id="scoredef-0000000835449959">
                        <staffGrp xml:id="staffgrp-0000000521679917" symbol="brace" bar.thru="true">
                            <labelAbbr xml:id="labelAbbr-0000000124206945" />
                            <staffDef xml:id="staffdef-0000001008106099" clef.shape="G" clef.line="2" key.sig="4f" meter.count="3" meter.unit="4" n="1" lines="5" />
                            <staffDef xml:id="staffdef-0000001915745831" clef.shape="F" clef.line="4" key.sig="4f" meter.count="3" meter.unit="4" n="2" lines="5" />
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1" n="0">
                            <staff xml:id="staff-0000001883556727" n="1">
                                <layer xml:id="layer-L1F2N1" n="1">
                                    <note xml:id="note-L8F2" dur="2" oct="4" pname="a" stem.dir="down" accid.ges="f" />
                                    <tuplet xml:id="tuplet-L12F2-L17F2" num="65" numbase="60" num.visible="false" bracket.visible="false" num.format="count">
                                        <beam xml:id="beam-L12F2-L17F2">
                                            <note xml:id="note-L12F2" dur="16" oct="4" pname="g" cue="true" stem.dir="down">
                                                <accid xml:id="accid-L12F2" accid="n" func="caution" />
                                            </note>
                                            <note xml:id="note-L13F2" dur="16" oct="4" pname="a" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L14F2" dur="16" oct="4" pname="b" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L16F2" dur="16" oct="5" pname="c" cue="true" stem.dir="down" accid.ges="n" />
                                            <note xml:id="note-L17F2" dur="16" oct="5" pname="d" cue="true" stem.dir="down" accid.ges="f" />
                                        </beam>
                                    </tuplet>
                                </layer>
                            </staff>
                            <staff xml:id="staff-0000000712878806" n="2">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L8F1" dur="4" oct="2" pname="a" accid.ges="f" />
                                    <chord xml:id="chord-L9F1" dur="4">
                                        <note xml:id="note-L9F1S1" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L9F1S2" oct="3" pname="a" accid.ges="f" />
                                        <note xml:id="note-L9F1S3" oct="3" pname="e" accid.ges="f" />
                                    </chord>
                                    <chord xml:id="chord-L12F1" dur="4">
                                        <note xml:id="note-L12F1S1" oct="4" pname="g" accid.ges="n" />
                                        <note xml:id="note-L12F1S2" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L12F1S3" oct="3" pname="a" accid.ges="f" />
                                    </chord>
                                </layer>
                            </staff>
                            <mordent xml:id="mordent-L8F2" staff="1" startid="#note-L8F2" form="upper" />
                            <pedal xml:id="pedal-0000000927786738" staff="2" tstamp="1.000000" dir="down" vgrp="200" />
                            <pedal xml:id="pedal-0000000101255741" staff="2" tstamp="3.692308" dir="up" vgrp="200" />
                            <slur xml:id="slur-L12F2-L29F2" staff="1" startid="#note-L12F2" endid="#note-L29F2" />
                        </measure>
                        <measure xml:id="measure-L18" n="69">
                            <staff xml:id="staff-L18F2N1" n="1">
                                <layer xml:id="layer-L18F2N1" n="1">
                                    <space xml:id="space-0000001704874457" />
                                    <tuplet xml:id="tuplet-L21F2-L29F2" num="104" numbase="96" num.visible="false" bracket.visible="false" num.format="count">
                                        <beam xml:id="beam-L21F2-L29F2">
                                            <note xml:id="note-L21F2" dur="16" oct="5" pname="e" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L22F2" dur="16" oct="5" pname="f" cue="true" stem.dir="down" accid.ges="n" />
                                            <note xml:id="note-L23F2" dur="16" oct="5" pname="g" cue="true" stem.dir="down" accid="f" />
                                            <note xml:id="note-L24F2" dur="16" oct="5" pname="a" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L26F2" dur="16" oct="5" pname="b" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L27F2" dur="16" oct="6" pname="c" cue="true" stem.dir="down" accid.ges="n" />
                                            <note xml:id="note-L28F2" dur="16" oct="6" pname="d" cue="true" stem.dir="down" accid.ges="f" />
                                            <note xml:id="note-L29F2" dur="16" oct="6" pname="e" cue="true" stem.dir="down" accid.ges="f" />
                                        </beam>
                                    </tuplet>
                                    <note xml:id="note-L33F2" dur="4" oct="6" pname="f" accid.ges="n">
                                        <artic xml:id="artic-L33F2" artic="stacciss" />
                                    </note>
                                </layer>
                            </staff>
                            <staff xml:id="staff-L18F1N1" n="2">
                                <layer xml:id="layer-L18F1N1" n="1">
                                    <note xml:id="note-L20F1" dur="4" oct="3" pname="d" accid.ges="f" />
                                    <chord xml:id="chord-L25F1" dur="4">
                                        <note xml:id="note-L25F1S1" oct="4" pname="d" accid.ges="f" />
                                        <note xml:id="note-L25F1S2" oct="3" pname="a" accid.ges="f" />
                                        <note xml:id="note-L25F1S3" oct="3" pname="f" accid.ges="n" />
                                    </chord>
                                    <chord xml:id="chord-L33F1" dur="4">
                                        <note xml:id="note-L33F1S1" oct="4" pname="f" accid.ges="n" />
                                        <note xml:id="note-L33F1S2" oct="4" pname="d" accid.ges="f" />
                                        <note xml:id="note-L33F1S3" oct="3" pname="a" accid.ges="f" />
                                    </chord>
                                </layer>
                            </staff>
                            <pedal xml:id="pedal-0000000328114848" staff="2" tstamp="1.000000" dir="down" vgrp="200" />
                            <pedal xml:id="pedal-0000001591554204" staff="2" tstamp="3.000000" dir="up" vgrp="200" />
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

When I added dur attribute (in this case set to 32, although it should be around 33,6 if I'm counting correctly) rendering became closer to the truth:

cross-measure-beam2


There's a lot to do in this case as I see it:

  1. Implementation of beamSpan in Verovio
  2. Implementation of partial barlines as attribute to measure in MEI
  3. Implementation of partial barlines in Verovio
  4. Implementation of cross-measure rhythms in Humdrum Extras.

Maybe double measures are not that bad after all ;) ?

jacekiwaszko1 commented 5 years ago

MEI documentation about <measure> and <barLine>:

It must be noted that, when both the MEI.cmn and MEI.mensural modules are available, it is possible to encode CMN notation without using <measure> elements; that is, staff-by-staff organization may be used and the ends of measures marked using <barLine> elements.

In certain circumstances, this approach may be preferable for reproduction of the visual layout of the music. However, the simultaneous use of the <measure> and <barLine> elements may lead to confusion and should be avoided.

Mixing those elements is not advisable but not forbidden to, if I understand correctly. And cases similar to the one above are not that often after all - I've found them only in two other Chopin pieces so far:

Ballade op. 23 (Schlesinger, Paris), mm. 246-247:

no-barline-b23

Grande Polonaise Brillante op. 22 (Schlesinger, Paris), mm. 175-176:

no-barline-P22

Not that I'm forcing anything :)

craigsapp commented 5 years ago

@lpugin can suggest the best way of encoding such examples in MEI for rendering with verovio. Aesthetically it does not look pretty to be mixing <barlines> and <measures>, particularly with respect to extracting measures from a score, but also for analytic purposes as well where the meaning of the meter becomes ambiguous. But I will be doing those sort of things in Humdrum, so ultimately I do not have a problem with mixing the two systems in MEI. I could even switch from <measures> to <barline> for all conversions if it is going to allow sufficient control without having to use a hybrid system.

Here is related discussion on the music-encoding repository: https://github.com/music-encoding/music-encoding/issues/470

I do allow "noteSpans" in the Humlib parser:

Screen Shot 2019-08-08 at 7 52 36 AM

Ideally MEI would allow independent stylings of the measure lines on each staff so that the upper one can be made invisible. Here is how it would be done in Humdrum:

**kern  **kern
=1  =1
1c  2f
.   1g
=   =-
1d  .
.   2a
=   =
*-  *-

Where =- means an invisible line.

In this case the MEI data is not technically using a notespan (as there is no concept of notespan in MEI (yet)). I overfill the previous measure and add a <space> in the next measure to implement the notespan:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
    <meiHead>
        <fileDesc>
            <titleStmt>
                <title />
            </titleStmt>
            <pubStmt />
        </fileDesc>
        <encodingDesc>
            <appInfo>
                <application isodate="2019-08-08T07:53:59" version="2.2.0-dev-d6bfcef-dirty">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000000562873242">
                <score xml:id="score-0000000953613997">
                    <scoreDef xml:id="scoredef-0000000282406289" midi.bpm="400">
                        <staffGrp xml:id="staffgrp-0000000278871234" symbol="brace" bar.thru="true">
                            <labelAbbr xml:id="labelAbbr-0000001304493241" />
                            <staffDef xml:id="staffdef-0000001460073507" clef.shape="G" clef.line="2" n="1" lines="5" />
                            <staffDef xml:id="staffdef-0000001389595208" clef.shape="G" clef.line="2" n="2" lines="5" />
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1" n="0">
                            <staff xml:id="staff-0000002053890247" n="1">
                                <layer xml:id="layer-L1F2N1" n="1">
                                    <note xml:id="note-L3F2" dur="2" oct="4" pname="f" accid.ges="n" />
                                    <note xml:id="note-L4F2" dur="1" oct="4" pname="g" accid.ges="n" />
                                </layer>
                            </staff>
                            <staff xml:id="staff-0000001475826256" n="2">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L3F1" dur="1" oct="4" pname="c" accid.ges="n" />
                                </layer>
                            </staff>
                        </measure>
                        <measure xml:id="measure-L5">
                            <staff xml:id="staff-L5F2N1" n="1">
                                <layer xml:id="layer-L5F2N1" n="1">
                                    <space xml:id="space-0000000139722832" dur="2" />
                                    <note xml:id="note-L7F2" dur="2" oct="4" pname="a" accid.ges="n" />
                                </layer>
                            </staff>
                            <staff xml:id="staff-L5F1N1" n="2">
                                <layer xml:id="layer-L5F1N1" n="1">
                                    <note xml:id="note-L6F1" dur="1" oct="4" pname="d" accid.ges="n" />
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

This sort of situation occurs often in Renaissance music rendered with barlines, where there are different durations for the metric cycles in each part.

An alternative encoding in such situations that I use when converting into MuseData for notation rendering is to split the note into a tied group, then hide the tied notes and visually adjust the shape of the first note back to the untied rhythm:

Screen Shot 2019-08-08 at 8 12 42 AM

This simplifies extracting measures from the data. However the tie cannot be made invisible in verovio. (I could add a post-processing hack by labelling the tie, and then using CSS to make it transparent).

MEI discussion on this point: https://github.com/music-encoding/music-encoding/issues/469

And a related discussion we had last year: https://github.com/humdrum-tools/verovio-humdrum-viewer/issues/150

In MusicXML when encoding by parts (which is the way MuseScore/Finale/Sibelius encode scores), the two staves would be encoded with different meters. The top staff would be encoded as one measure with 6 quarters, and the bottom staff would be encoded as two measures with three quarters each.

craigsapp commented 4 years ago

Implemented with commit https://github.com/rism-ch/verovio/commit/990d69c368b4fdb4db166847ddbf3ae44c2b73f5

Encoding example for:

partial-barline-orig

Now renders as:

Screen Shot 2020-07-11 at 11 13 46 PM

(I will have to work on the rhythmic scaling of the tuplet group)

Humdrum encoding:

**kern  **kern  **dynam
*staff2 *staff1 *
*clefF4 *clefG2 *
*k[b-e-a-d-]    *k[b-e-a-d-]    *
*M3/4   *M3/4   *
=68 =68 =68
*ped    *   *
4AA-    2a-M>\  .
4c 4A- 4E-  .   .
*   *Xtuplet    *
*   *cue    *
4g 4c 4A-   (>52%3gn\L  .
.   52%3a-\ .
.   52%3b-\ .
*Xped   *   *
.   52%3cc\ .
.   52%3dd-\    .
*ped    *   *
=69 =69-    =69
4D- .   .
.   52%3ee-\    .
.   52%3ff\ .
.   52%3gg-X\   .
.   52%3aa-\    .
4d- 4A- 4F  .   .
.   52%3bb-\    .
.   52%3ccc\    .
.   52%3ddd-\   .
.   52%3eee-\J) .
*   *Xcue   *
*   *tuplet *
*Xped   *   *
4f 4d- 4A-  4fff`>  .
=70 =70 =70
*-  *-  *-

The converter notices that the two barlines for measure 69 are not the same:

=69 =69-

So they are converted from <measure> to <barLine> in the MEI conversion, with the invisible barline dropped from the translation completely (but invisible <measure>s will not be dropped).

MEI conversion:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/4.0.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<mei xmlns="http://www.music-encoding.org/ns/mei" meiversion="4.0.0">
 <meiHead>
  <fileDesc>
   <titleStmt>
    <title />
   </titleStmt>
   <pubStmt />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2020-07-11T23:14:57" version="3.0.0-dev-5a5726a">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mdiv-0000001986621724">
    <score xml:id="score-0000000075571712">
     <scoreDef xml:id="scoredef-0000000870892347">
      <staffGrp xml:id="staffgrp-0000000238953093" symbol="brace" bar.thru="true">
       <staffDef xml:id="staffdef-0000001809625143" n="1" lines="5">
        <clef xml:id="clef-L3F2" shape="G" line="2" />
        <keySig xml:id="keysig-L4F2" sig="4f" />
        <meterSig xml:id="metersig-L5F2" count="3" unit="4" />
       </staffDef>
       <staffDef xml:id="staffdef-0000000731188534" n="2" lines="5">
        <clef xml:id="clef-L3F1" shape="F" line="4" />
        <keySig xml:id="keysig-L4F1" sig="4f" />
        <meterSig xml:id="metersig-L5F1" count="3" unit="4" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1" n="68">
       <staff xml:id="staff-0000001052670511" n="1">
        <layer xml:id="layer-L1F2N1" n="1">
         <note xml:id="note-L8F2" dur="2" oct="4" pname="a" stem.dir="down" accid.ges="f" />
         <tuplet xml:id="tuplet-L12F2-L29F2" num="13" numbase="12" num.visible="false" bracket.visible="false" num.format="count">
          <beam xml:id="beam-L12F2-L29F2">
           <note xml:id="note-L12F2" dur="16" oct="4" pname="g" cue="true" stem.dir="down">
            <accid xml:id="accid-L12F2" accid="n" func="caution" />
           </note>
           <note xml:id="note-L13F2" dur="16" oct="4" pname="a" cue="true" stem.dir="down" accid.ges="f" />
           <note xml:id="note-L14F2" dur="16" oct="4" pname="b" cue="true" stem.dir="down" accid.ges="f" />
           <note xml:id="note-L16F2" dur="16" oct="5" pname="c" cue="true" stem.dir="down" accid.ges="n" />
           <note xml:id="note-L17F2" dur="16" oct="5" pname="d" cue="true" stem.dir="down" accid.ges="f" />
           <note xml:id="note-L21F2" dur="16" oct="5" pname="e" cue="true" stem.dir="down" accid.ges="f" />
           <note xml:id="note-L22F2" dur="16" oct="5" pname="f" cue="true" stem.dir="down" accid.ges="n" />
           <note xml:id="note-L23F2" dur="16" oct="5" pname="g" cue="true" stem.dir="down" accid="f" />
           <note xml:id="note-L24F2" dur="16" oct="5" pname="a" cue="true" stem.dir="down" accid.ges="f" />
           <note xml:id="note-L26F2" dur="16" oct="5" pname="b" cue="true" stem.dir="down" accid.ges="f" />
           <note xml:id="note-L27F2" dur="16" oct="6" pname="c" cue="true" stem.dir="down" accid.ges="n" />
           <note xml:id="note-L28F2" dur="16" oct="6" pname="d" cue="true" stem.dir="down" accid.ges="f" />
           <note xml:id="note-L29F2" dur="16" oct="6" pname="e" cue="true" stem.dir="down" accid.ges="f" />
          </beam>
         </tuplet>
         <note xml:id="note-L33F2" dur="4" oct="6" pname="f" accid.ges="n">
          <artic xml:id="artic-L33F2" artic="stacciss" />
         </note>
        </layer>
       </staff>
       <staff xml:id="staff-0000001262994391" n="2">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L8F1" dur="4" oct="2" pname="a" accid.ges="f" />
         <chord xml:id="chord-L9F1" dur="4">
          <note xml:id="note-L9F1S1" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L9F1S2" oct="3" pname="a" accid.ges="f" />
          <note xml:id="note-L9F1S3" oct="3" pname="e" accid.ges="f" />
         </chord>
         <chord xml:id="chord-L12F1" dur="4">
          <note xml:id="note-L12F1S1" oct="4" pname="g" accid.ges="n" />
          <note xml:id="note-L12F1S2" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L12F1S3" oct="3" pname="a" accid.ges="f" />
         </chord>
         <barLine xml:id="barline-L19F1" />
         <note xml:id="note-L20F1" dur="4" oct="3" pname="d" accid.ges="f" />
         <chord xml:id="chord-L25F1" dur="4">
          <note xml:id="note-L25F1S1" oct="4" pname="d" accid.ges="f" />
          <note xml:id="note-L25F1S2" oct="3" pname="a" accid.ges="f" />
          <note xml:id="note-L25F1S3" oct="3" pname="f" accid.ges="n" />
         </chord>
         <chord xml:id="chord-L33F1" dur="4">
          <note xml:id="note-L33F1S1" oct="4" pname="f" accid.ges="n" />
          <note xml:id="note-L33F1S2" oct="4" pname="d" accid.ges="f" />
          <note xml:id="note-L33F1S3" oct="3" pname="a" accid.ges="f" />
         </chord>
        </layer>
       </staff>
       <mordent xml:id="mordent-L8F2" staff="1" startid="#note-L8F2" form="upper" />
       <slur xml:id="slur-L12F2-L29F2" staff="1" startid="#note-L12F2" endid="#note-L29F2" />
       <pedal xml:id="pedal-0000000107866212" staff="2" tstamp="1.000000" dir="down" />
       <pedal xml:id="pedal-0000001603193697" staff="2" tstamp="3.692308" dir="up" />
       <pedal xml:id="pedal-0000000399146570" staff="2" tstamp="4.000000" dir="down" />
       <pedal xml:id="pedal-0000001756537714" staff="2" tstamp="6.000000" dir="up" />
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>
craigsapp commented 4 years ago

In VHV:

Screen Shot 2020-07-11 at 11 35 47 PM