Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non lazy beaming #10

Closed
davidrizo opened this issue Apr 25, 2020 · 2 comments
Closed

Non lazy beaming #10

davidrizo opened this issue Apr 25, 2020 · 2 comments
Assignees
Labels

Comments

@davidrizo
Copy link
Collaborator

The example in the documentation of non lazy beaming contains a k signifier that is not explained (I'm sorry if I'm missing something). In fact, if removed the result is the same
image

I wonder if it's necessary to encode the first beam group in this weird unit test (don't look at the cross-measure beam that's not supported in VHV or the rest starting a beam):
image

If encoded using lazy beaming with:

**kern
*clefG2
*M4/4
*met(c)
32cL
32d
16e
*clefF4
32FF
32BB
32AA
32GGJ
*clefG2
8r
16ccL
8dd
8r
16eeJ
8r
8cc
=
*-

we get
image

If we want to encode the same number of beams of the example we need to use a non-lazy approach, we get no note beamed. Is my encoding wrong, should I add some k or is it VHV?

**kern
*clefG2
*M4/4
*met(c)
32cLLL
32dJ
16eJ
*clefF4
32FFLL
32BB
32AA
32GGJJ
*clefG2
8r
16ccL
8dd
8r
16eeJ
8r
8cc
=
*-

Thanks !!

@craigsapp
Copy link
Member

The example in the documentation of non lazy beaming contains a k signifier that is not explained (I'm sorry if I'm missing something). In fact, if removed the result is the same

The k means a flag (partial beam) on the note that extends to the left. A K means a partial beam to the right. k vs. K cannot be controlled in verovio (I believe), so that is one reason why the result is the same). These controls probably have an effect in mup, which was the original notation system used for Humdrum data (via the ms command in the Humdrum Toolkit).

Here is an example of K and k in the same beam:

kK

the second flag on the third note is incorrectly positioned to the left (k), and should go to the right (K), but there is no control to correct it in verovio currently.


Somewhat related explanations:

MEI (and by extension verovio) only does lazy beaming, which is another reason why beaming information might not change. To control the visual aspect of the beams (such as how many beam lines), note@dur is used (and note@dur.ges gives the "true" duration if it conflicts with the visual duration).

Here are examples of how to control the beaming in MEI from Humdrum (where the beaming is always interpreted as lazy):

beaming

There are two methods:

(1) Use an *rscale tandem interpretation to set a rhythmic scaling. In the example, the durations of the notes are multiplied by 2 to convert from sixteenth notes to eighth notes. Then use *rscale:1 to cancel the rhythmic scaling.

(2) Use a note layout parameter !LO:N to control the visual rhythm of each note (making all of them appear like eighth notes in this case). This method is more suitable for changing the visual duration of single notes, while the rscale method is best for changing a sequence of notes by the same factor.

Humdrum data for example:

**kern
=1
16cLL
16d
16e
16fJJ
*rscale:2
16cLL
16d
16e
16fJJ
*rscale:1
16cLL
16d
16e
16fJJ
!LO:N:vis=8
16cLL
!LO:N:vis=8
16d
!LO:N:vis=8
16e
!LO:N:vis=8
16fJJ
*-

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-04-25T11:30:10" version="2.7.0-dev-9b84e3d">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000000340418143">
                <score xml:id="score-0000001581373570">
                    <scoreDef xml:id="scoredef-0000001825449832">
                        <staffGrp xml:id="staffgrp-0000000684956137">
                            <staffDef xml:id="staffdef-0000000033103376" n="1" lines="5">
                                <clef xml:id="clef-0000000136949060" shape="G" line="2" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1" right="invis" n="1">
                            <staff xml:id="staff-0000002137158120" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <beam xml:id="beam-L3F1-L6F1">
                                        <note xml:id="note-L3F1" dur="16" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L4F1" dur="16" oct="4" pname="d" accid.ges="n" />
                                        <note xml:id="note-L5F1" dur="16" oct="4" pname="e" accid.ges="n" />
                                        <note xml:id="note-L6F1" dur="16" oct="4" pname="f" accid.ges="n" />
                                    </beam>
                                    <beam xml:id="beam-L8F1-L11F1">
                                        <note xml:id="note-L8F1" dur.ges="16" dur="8" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L9F1" dur.ges="16" dur="8" oct="4" pname="d" accid.ges="n" />
                                        <note xml:id="note-L10F1" dur.ges="16" dur="8" oct="4" pname="e" accid.ges="n" />
                                        <note xml:id="note-L11F1" dur.ges="16" dur="8" oct="4" pname="f" accid.ges="n" />
                                    </beam>
                                    <beam xml:id="beam-L13F1-L16F1">
                                        <note xml:id="note-L13F1" dur="16" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L14F1" dur="16" oct="4" pname="d" accid.ges="n" />
                                        <note xml:id="note-L15F1" dur="16" oct="4" pname="e" accid.ges="n" />
                                        <note xml:id="note-L16F1" dur="16" oct="4" pname="f" accid.ges="n" />
                                    </beam>
                                    <beam xml:id="beam-L18F1-L24F1">
                                        <note xml:id="note-L18F1" dur.ges="16" dur="8" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L20F1" dur.ges="16" dur="8" oct="4" pname="d" accid.ges="n" />
                                        <note xml:id="note-L22F1" dur.ges="16" dur="8" oct="4" pname="e" accid.ges="n" />
                                        <note xml:id="note-L24F1" dur.ges="16" dur="8" oct="4" pname="f" accid.ges="n" />
                                    </beam>
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

@craigsapp craigsapp self-assigned this Apr 25, 2020
@craigsapp
Copy link
Member

For the second example:

If we want to encode the same number of beams of the example we need to use a non-lazy approach, we get no note beamed

You had a typo in the example: there is a missing J on the last note of the beamed group (you have two, but there should be three):

balance

The converter from Humdrum to MEI will refuse to convert any beam on a staff in a measure if the 'L' and 'J' counts do not match (this is true of both lazy and non-lazy beaming where they always have to match). This is mostly for visually identifying unbalanced beaming in the notation. When cross-beaming is allowed, I will have to think how to deal with this rule (such as allow the sum of two adjacent measures to have balanced 'L' and 'J', or mark somehow that a beam is allowed to cross the staff.


The exact beaming is needed in this case if you want to capture the beam depth of "1" over the clef. By default verovio will choose two beamlets in this case. And to break the beamlet to the primary beam, note@breaksec="1" needs to be added to change to 1 beam instead of 2. This is controlled in the converter from Humdrum to MEI with the non-lazy beaming method:

beambreak

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-04-25T12:15:54" version="2.7.0-dev-9b84e3d">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workList>
            <work>
                <title />
            </work>
        </workList>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000000023058483">
                <score xml:id="score-0000000431115248">
                    <scoreDef xml:id="scoredef-0000000586266704">
                        <staffGrp xml:id="staffgrp-0000001700744968">
                            <staffDef xml:id="staffdef-0000001406253599" n="1" lines="5">
                                <clef xml:id="clef-0000000315455034" shape="G" line="2" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1">
                            <staff xml:id="staff-0000000109353177" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <beam xml:id="beam-L3F1-L6F1">
                                        <note xml:id="note-L3F1" dur="32" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L4F1" dur="32" oct="4" pname="d" accid.ges="n" />
                                        <note xml:id="note-L5F1" dur="32" oct="4" pname="e" accid.ges="n" />
                                        <note xml:id="note-L6F1" dur="32" oct="4" pname="f" accid.ges="n" />
                                    </beam>
                                    <beam xml:id="beam-L7F1-L10F1">
                                        <note xml:id="note-L7F1" dur="32" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L8F1" breaksec="2" dur="32" oct="4" pname="d" accid.ges="n" />
                                        <note xml:id="note-L9F1" dur="32" oct="4" pname="e" accid.ges="n" />
                                        <note xml:id="note-L10F1" dur="32" oct="4" pname="f" accid.ges="n" />
                                    </beam>
                                    <beam xml:id="beam-L11F1-L14F1">
                                        <note xml:id="note-L11F1" dur="32" oct="4" pname="c" accid.ges="n" />
                                        <note xml:id="note-L12F1" breaksec="1" dur="32" oct="4" pname="d" accid.ges="n" />
                                        <note xml:id="note-L13F1" dur="32" oct="4" pname="e" accid.ges="n" />
                                        <note xml:id="note-L14F1" dur="32" oct="4" pname="f" accid.ges="n" />
                                    </beam>
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

This can also be done by lazy beaming, by placing LL at the start of the beam, JJ at the end of the beam, and then using J/L to control the location of beam break(s) within the measure.


For the second beam, lazy beaming will work. The first note of the beam should have a K for non-lazy beaming, but k/K are currently ignored when converting from Humdrum to MEI.

Starting the beam on the rests is causing a bug in verovio. Verovio beaming was recently redone, and the bug probably happened at that time. The problem is that the rest has no stem, so some very low default value is being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants