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

implement note@dots.ges #757

Closed
craigsapp opened this issue Feb 12, 2018 · 17 comments
Closed

implement note@dots.ges #757

craigsapp opened this issue Feb 12, 2018 · 17 comments

Comments

@craigsapp
Copy link
Contributor

Visual dots expressed as <note/><dot/> are displayed in verovio renderings, but <note><dot/></note> are not. It would be useful to allow visual dots as note child elements so that visual dots can be applied to chords or individual notes in chords.

Test data:

<?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="2018-02-12T08:28:50" version="2.0.0-dev-187bb37">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workDesc>
            <work>
                <titleStmt>
                    <title />
                </titleStmt>
            </work>
        </workDesc>
    </meiHead>
    <music>
        <body>
            <mdiv>
                <score>
                    <scoreDef xml:id="scoredef-0000000542275399">
                        <staffGrp xml:id="staffgrp-0000001902737946">
                            <staffDef xml:id="staffdef-0000000812308539" clef.shape="G" clef.line="2" n="1" lines="5">
                                <label xml:id="label-0000000664401644">    </label>
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-0000001601493186">
                        <measure xml:id="measure-L1" right="invis" n="0">
                            <staff xml:id="staff-0000000671361295" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <chord xml:id="chord-L2F1" dur="4">
                                        <note xml:id="note-L2F1S1" oct="4" pname="c" accid.ges="n"> 
                                           <dot/> 
                                        </note>
                                        <note xml:id="note-L2F1S2" oct="4" pname="e" accid.ges="n"> 
                                            <dot/> 
                                        </note>
                                        <note xml:id="note-L2F1S3" oct="4" pname="g" accid.ges="n"> 
                                           <dot/> 
                                        </note>
                                    </chord>
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

Currently renders as:

screen shot 2018-02-12 at 8 32 57 am

But should render with visual augmentation dots after each note in the chord.

Alternately or in addition, allowing for <chord><dot/></chord> rendering would be good, although <dot> is not allowed as contents of <chord> in the 3.0.0 MEI spec:
http://music-encoding.org/documentation/3.0.0/chord

@rettinghaus
Copy link
Contributor

… as asked for in #559 :-)

@lpugin
Copy link
Contributor

lpugin commented Feb 12, 2018

Yes, and already answered there...

The plan is to support the duration and dots to be overwritten in <note> within <chord> (see #754 ) So you would do:

<chord dur="4" dots="1">
  <note />
  <note dots="0"/>
</chord>

@craigsapp
Copy link
Contributor Author

That should be OK, but semantically it is not what may be desired. The problem with:

<chord dur="4" dots="1">
  <note />
  <note dots="0"/>
</chord>

Is that @dots is primarily a rhythm modifier. The above encoding would mean that there are two notes in a chord. The chord has a duration of a dotted-quarter, but the duration of the two notes are different. The first note has a duration of a dotted quarter note, and the second one has the duration of a quarter note. So when played as a MIDI file the second note would end before the first one.

It would be nice to have semantics for: The chord has the duration of a dotted-quarter. The two notes in the chord have the same duration of a dotted-quarter, but the second note is missing a visual dot.

My example above does not deal with this case (removing a dot that should be there) in any case, but rather adding a dot that should not be there:

<chord dur="4">
  <note />
  <note>
       <dot/>
  </note>
</chord>

In this case the duration of the chord is a quarter, and the two notes in the chord both have a duration of a quarter, while the second one has an additional augmentation dot that should not be considered part of the rhythm.

@pe-ro
Copy link

pe-ro commented Feb 13, 2018

<chord dur="4">
  <note />
  <note>
    <sic>
      <dot/>
    </sic>
  </note>
</chord>

will do the job.

@craigsapp
Copy link
Contributor Author

Even better.

@lpugin
Copy link
Contributor

lpugin commented Feb 13, 2018

The above encoding would mean that there are two notes in a chord. The chord has a duration of a dotted-quarter, but the duration of the two notes are different. The first note has a duration of a dotted quarter note, and the second one has the duration of a quarter note. So when played as a MIDI file the second note would end before the first one.

Correct, and this is what I expect to happen with chords with notes with multiple durations.

It would be nice to have semantics for: The chord has the duration of a dotted-quarter. The two notes in the chord have the same duration of a dotted-quarter, but the second note is missing a visual dot.

I agree too that it would be nice to be able to make the difference. Now for me this does not have to go through promoting attributes to elements. Actually we already have this for durations with @dur and @dur.ges. So my proposal would be to align dot encoding with this and to have a @dots.ges attribute.

@lpugin
Copy link
Contributor

lpugin commented Feb 13, 2018

The example for your case would be something like:

<chord dur="4" dots="1">
  <note />
  <note dots="0" dots.ges="1" />
</chord>

@craigsapp
Copy link
Contributor Author

That would work for me. That method would be useful for encoding implicit perfect durations (simulate mensural music notation in modern notation, as well as some J.S. Bach pieces). <sic> style dot markup would eventually be useful to implement for editorial cases where a dot is missing or added due to an apparent error.

@rettinghaus
Copy link
Contributor

#758 will handle the visual part for now.
MIDI needs to be fixed, so that <note><dot/></note> prolongs the note while <note><sic><dot/></sic></note> doesn't.

@craigsapp craigsapp changed the title implement note/dot implement note@dots.ges Feb 14, 2018
@craigsapp
Copy link
Contributor Author

Summary of the proposed enhancement:

To add a visual augmentation dot to a note that does not affect the rhythm:

<note dur="4" dots="1" dots.ges="0">

And to hide a visual dot, but allow it to affect the duration of the note:

<note dur="4" dots="0" dots.ges="1">

So when calculating logical duration (i.e., the duration value for score alignment and MIDI duration calculations), an element would first be searched for @dots.ges, and if it is defined, use that value to calculate the duration. If it is not found, then use @dots to calculate the duration. If there is no @dots.ges or @dots attributes, then use the implicit value of 0 dots in the logical duration calculation.

This system is similar to the @accid/@accid.ges system for accidentals.

For the chord case given above:

<chord dur="4" dots="1">
  <note />
  <note dots="0" dots.ges="1" />
</chord>

The logical duration of the second note is calculated from chord@dur (since there is no note@dur). The first note's logical duration is calculated from chord@dur and chord@dots, while the second note's logical duration is calculated from chord@dur and note@dots.ges.


Note that this also extents to @dur/@dur.ges as well:

Here is the encoding for a note which looks like a dotted-quarter note, but for gestural purposes is a whole note:

<note dur="4" dur.ges="1" dots="1" dots.ges="0">

And here is the reverse: a note that looks like a whole note, but is a dotted quarter note for gestural purposes:

<note dur="1" dur.ges="4" dots="0" dots.ges="1">

@pe-ro
Copy link

pe-ro commented Feb 14, 2018

If you'd like to add @dots.ges to v. 4, please submit an issue in the music-encoding repo.

@jacekiwaszko1
Copy link

Here is a sample encoding to test the implementation of @dots.ges:

<?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="2018-03-26T11:19:32" version="2.0.0-dev-314ae07">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workDesc>
            <work>
                <titleStmt>
                    <title />
                </titleStmt>
            </work>
        </workDesc>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000000738546588">
                <score xml:id="score-0000000147287005">
                    <scoreDef xml:id="scoredef-0000000586743257" midi.bpm="400">
                        <staffGrp xml:id="staffgrp-0000001099430517" symbol="brace" barthru="true">
                            <staffDef xml:id="staffdef-0000001918567115" clef.shape="G" clef.line="2" n="1" lines="5">
                                <label xml:id="label-0000001402844856" />
                            </staffDef>
                            <staffDef xml:id="staffdef-0000001720652433" clef.shape="G" clef.line="2" n="2" lines="5" />
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-0000000410821013">
                        <measure xml:id="measure-L1" right="end" n="0">
                            <staff xml:id="staff-0000001881661640" n="1">
                                <layer xml:id="layer-L1F2N1" n="1">
                                    <note xml:id="note-L3F2" dots="1" dur="4" oct="5" pname="c" accid.ges="n" />
                                    <note xml:id="note-L4F2" dur="4" dots="1" oct="5" pname="e" accid.ges="n" />
                                </layer>
                            </staff>
                            <staff xml:id="staff-0000001548245385" n="2">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L3F1" dur.ges="4" dots.ges="1" dots="0" dur="4" oct="4" pname="c" accid.ges="n" />
                                    <note xml:id="note-L4F1" dur="4" dots="1" oct="4" pname="e" accid.ges="n" />
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

Current rendering:

example1

The goal is to add a "hidden" augmentation dot to the first note on the bottom staff so that the second note is aligned with the second note on the top staff.

Here is the first note on the bottom staff:

<note xml:id="note-L3F1" 
       dur.ges="4" dots.ges="1"
       dur="4" dots="0"
       oct="4" pname="c" accid.ges="n" />

Is this the correct way to encode the note for this case? In this case @dots is set to zero, and @dots.ges is set to one. The intended effect is to have no visual dot, since @dots="0", but the logical duration of the note is a dotted quarter note due to @dots.ges="1". Also, would @dots="0" be necessary, or would not specifying @dots be sufficent?

Since @dur="4" and @dur.ges="4" contain the same value, is @dur.ges neded in this case?

@craigsapp
Copy link
Contributor Author

Does @dots.ges exist in MEI yet? I don't think it is implemented in verovio, according to this test:

screen shot 2018-10-08 at 5 02 27 am

The above notation should have the last two notes vertically aligned and an invisible dot on the C5 note. It does not have an invisible one. The idea is that @dots.ges would give the proper spacing duration for the note by adding the dot to the @dur.ges.

<?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="2018-10-08T05:01:14" version="2.0.0-dev-1cc1ef8">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workDesc>
            <work>
                <titleStmt>
                    <title />
                </titleStmt>
            </work>
        </workDesc>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000001880251780">
                <score xml:id="score-0000001294145305">
                    <scoreDef xml:id="scoredef-0000001249511058" midi.bpm="400">
                        <staffGrp xml:id="staffgrp-0000001611685941">
                            <staffDef xml:id="staffdef-0000000102861772" clef.shape="G" clef.line="2" n="1" lines="5">
                                <label xml:id="label-0000000285020968" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1" n="0">
                            <staff xml:id="staff-0000000787278937" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L4F1" dur.ges="4" dots.ges="1" dur="4" dots="0" oct="5" pname="c" stem.len="6.500000" accid.ges="n" />
                                    <note xml:id="note-L5F1" dots="1" dur="4" oct="5" pname="d" stem.len="6.000000" accid.ges="n" />
                                </layer>
                                <layer xml:id="layer-L4F2N2" n="2">
                                    <note xml:id="note-L4F2" dots="1" dur="4" oct="4" pname="d" stem.len="5.500000" accid.ges="n" />
                                    <note xml:id="note-L5F2" dots="1" dur="4" oct="4" pname="f" stem.len="5.500000" accid.ges="n" />
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

@pe-ro
Copy link

pe-ro commented Oct 8, 2018

Use <space dur="8"/> to replace the missing dot.

@craigsapp
Copy link
Contributor Author

Yes, that would work for correct notational display, so maybe I will use that for now. It would be somewhat unoptimal for generating MIDI, as there will be a gap in the sound that is not desired. There are also implications for music analysis: phrasing analysis if a repertory may use rests to segment phrases in certain repertories, but in this case the space should not be considered.

But how about the opposite case where there is a dot that should not be there (an uninvisible dot added as a typographical error in a manuscript/print). Can/should <dot> be used in CMN module of MEI?

@lpugin
Copy link
Contributor

lpugin commented Oct 8, 2018

Implemented e487e13

Works also for the opposite situation

<?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="2018-10-08T05:01:14" version="2.0.0-dev-1cc1ef8">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workDesc>
            <work>
                <titleStmt>
                    <title />
                </titleStmt>
            </work>
        </workDesc>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000001880251780">
                <score xml:id="score-0000001294145305">
                    <scoreDef xml:id="scoredef-0000001249511058" midi.bpm="400">
                        <staffGrp xml:id="staffgrp-0000001611685941">
                            <staffDef xml:id="staffdef-0000000102861772" clef.shape="G" clef.line="2" n="1" lines="5">
                                <label xml:id="label-0000000285020968" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1" n="0">
                            <staff xml:id="staff-0000000787278937" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L4F12" dur.ges="4" dots.ges="0" dur="4" dots="1" oct="5" pname="c" stem.len="6.500000" accid.ges="n" />
                                    <note xml:id="note-L5F12" dots="1" dur="4" oct="5" pname="d" stem.len="6.000000" accid.ges="n" />
                                </layer>
                                <layer xml:id="layer-L4F2N2" n="2">
                                    <note xml:id="note-L4F22" dur="4" oct="4" pname="d" stem.len="5.500000" accid.ges="n" />
                                    <note xml:id="note-L5F22" dots="1" dur="4" oct="4" pname="f" stem.len="5.500000" accid.ges="n" />
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

@lpugin lpugin closed this as completed Oct 8, 2018
@craigsapp
Copy link
Contributor Author

Looks great!:

screen shot 2018-10-08 at 5 44 17 pm

<?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="2018-10-08T17:42:55" version="2.0.0-dev-1cc1ef8">
                    <name>Verovio</name>
                    <p>Transcoded from Humdrum</p>
                </application>
            </appInfo>
        </encodingDesc>
        <workDesc>
            <work>
                <titleStmt>
                    <title />
                </titleStmt>
            </work>
        </workDesc>
        <extMeta>
            <frames xmlns:humxml="http://www.humdrum.org/ns/humxml">
                <metaFrame n="15" token="!!!RDF**kern: @ = marked note" xml:id="loc15">
                    <frameInfo>
                        <startTime float="5" />
                        <frameType>reference</frameType>
                        <referenceKey>RDF**kern</referenceKey>
                        <referenceValue>@ = marked note</referenceValue>
                    </frameInfo>
                </metaFrame>
            </frames>
        </extMeta>
    </meiHead>
    <music>
        <body>
            <mdiv xml:id="mdiv-0000001712877995">
                <score xml:id="score-0000001322173930">
                    <scoreDef xml:id="scoredef-0000001589089041" midi.bpm="400">
                        <staffGrp xml:id="staffgrp-0000001159358684">
                            <staffDef xml:id="staffdef-0000000628691972" clef.shape="G" clef.line="2" meter.count="6" meter.unit="8" n="1" lines="5">
                                <label xml:id="label-0000000226879165" />
                            </staffDef>
                        </staffGrp>
                    </scoreDef>
                    <section xml:id="section-L1F1">
                        <measure xml:id="measure-L1" n="0">
                            <staff xml:id="staff-0000001679561681" n="1">
                                <layer xml:id="layer-L1F1N1" n="1">
                                    <note xml:id="note-L5F1" dots.ges="1" type="marked" dur.ges="4" dur="4" oct="5" pname="c" color="red" stem.len="6.500000" accid.ges="n" />
                                    <note xml:id="note-L6F1" dots="1" dur="4" oct="5" pname="d" stem.len="6.000000" accid.ges="n" />
                                </layer>
                                <layer xml:id="layer-L5F2N2" n="2">
                                    <note xml:id="note-L5F2" dots="1" dur="4" oct="4" pname="c" stem.len="5.500000" accid.ges="n" />
                                    <note xml:id="note-L6F2" dots="1" dur="4" oct="4" pname="b" accid.ges="n" />
                                </layer>
                            </staff>
                        </measure>
                        <scoreDef xml:id="scoredef-0000002009745369" meter.count="2" meter.unit="4" />
                        <measure xml:id="measure-L7">
                            <staff xml:id="staff-L7F1N1" n="1">
                                <layer xml:id="layer-L7F1N1" n="1">
                                    <note xml:id="note-L10F1" type="marked" dots="1" dots.ges="0" dur.ges="4" dur="4" oct="5" pname="e" color="red" stem.len="5.500000" accid.ges="n" />
                                    <note xml:id="note-L11F1" dur="4" oct="5" pname="f" stem.len="5.500000" accid.ges="n" />
                                </layer>
                                <layer xml:id="layer-L7F2N2" n="2">
                                    <note xml:id="note-L10F2" dur="4" oct="4" pname="a" stem.len="6.500000" accid.ges="n" />
                                    <note xml:id="note-L11F2" dur="4" oct="4" pname="f" stem.len="5.500000" accid.ges="n" />
                                </layer>
                            </staff>
                        </measure>
                    </section>
                </score>
            </mdiv>
        </body>
    </music>
</mei>

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

No branches or pull requests

5 participants