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

Three Humdrum input fixes #3541

Merged

Conversation

gregchapman-dev
Copy link
Contributor

@gregchapman-dev gregchapman-dev commented Nov 5, 2023

  1. Check timetok for NULL before looking for "yy" in it.
  2. Be non-ambiguous about @dots.ges in the presence of @dur.ges (don't assume processors will default missing @dots.ges to 0, or to @dots).
  3. Fix two **silbe replaceDestructive() calls that had their string params reversed (they were inserting the pattern they were trying to remove).

@craigsapp
Copy link
Contributor

First and third commits are great (good catch on the third).

Can you give an example of what the second one fixes? Do you mean that if @dots.ges is nonzero, then @dots should be zero (instead of empty)?

I do notice a problem with dots when the secondary notes of a chord have augmentation dots and the first note does not (last case below):

Screenshot 2023-11-05 at 10 19 49

View in VHV

Click to view MEI data for above example
<?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 />
  </fileDesc>
  <encodingDesc>
   <appInfo>
    <application isodate="2023-11-05T10:24:38" version="4.1.0-dev-e671927">
     <name>Verovio</name>
     <p>Transcoded from Humdrum</p>
    </application>
   </appInfo>
  </encodingDesc>
  <workList>
   <work>
    <title />
   </work>
  </workList>
 </meiHead>
 <music>
  <body>
   <mdiv xml:id="mrrsda9">
    <score xml:id="sl7rerq">
     <scoreDef xml:id="ssw2u" midi.bpm="400.000000">
      <staffGrp xml:id="sgmtwpf">
       <staffDef xml:id="staffdef-L1F1" n="1" lines="5">
        <clef xml:id="c4rxqj" shape="G" line="2" />
       </staffDef>
      </staffGrp>
     </scoreDef>
     <section xml:id="section-L1F1">
      <measure xml:id="measure-L1">
       <staff xml:id="staff-L1F1" n="1">
        <layer xml:id="layer-L1F1N1" n="1">
         <note xml:id="note-L4F1" dots="1" dur.ges="4" dots.ges="0" dur="2" oct="4" pname="c" accid.ges="n" />
         <note xml:id="note-L6F1" dots="0" dur.ges="4" dots.ges="1" dur="2" oct="4" pname="c" accid.ges="n" />
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L7">
       <staff xml:id="staff-L7F1N1" n="1">
        <layer xml:id="layer-L7F1N1" n="1">
         <chord xml:id="chord-L9F1" dur="2">
          <note xml:id="note-L9F1S1" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L9F1S2" dots="1" dur.ges="2" dots.ges="0" dur="2" oct="4" pname="g" accid.ges="n" />
         </chord>
         <chord xml:id="chord-L11F1" dots="1" dur="2">
          <note xml:id="note-L11F1S1" dots="0" dur.ges="2" dots.ges="1" dur="2" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L11F1S2" oct="4" pname="g" accid.ges="n" />
         </chord>
        </layer>
       </staff>
      </measure>
      <measure xml:id="measure-L12">
       <staff xml:id="staff-L12F1N1" n="1">
        <layer xml:id="layer-L12F1N1" n="1">
         <chord xml:id="chord-L13F1" dots="1" dur="2">
          <note xml:id="note-L13F1S1" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L13F1S2" dots="0" oct="4" pname="g" accid.ges="n" />
         </chord>
         <chord xml:id="chord-L15F1" dur="2">
          <note xml:id="note-L15F1S1" oct="4" pname="c" accid.ges="n" />
          <note xml:id="note-L15F1S2" dots="2" oct="4" pname="g" accid.ges="n" />
         </chord>
        </layer>
       </staff>
      </measure>
     </section>
    </score>
   </mdiv>
  </body>
 </music>
</mei>

Problem case (probably unrelated):

<chord xml:id="chord-L15F1" dur="2">
   <note xml:id="note-L15F1S1" oct="4" pname="c" accid.ges="n" />
   <note xml:id="note-L15F1S2" dots="2" oct="4" pname="g" accid.ges="n" />
</chord>

@dots="2" should be @dots="1" on the second note.

@gregchapman-dev
Copy link
Contributor Author

gregchapman-dev commented Nov 5, 2023

The second fix is about a discussion I had on the MEI slack with Perry Roland and Laurent Pugin. I was trying to figure out how my MEI parser should interpret @dur.ges with missing @dots.ges. Should gestural duration be assumed to be @dur.ges + 0? Or should it be assumed to be @dur.ges + @dots? I got both answers, one from Perry and one from Laurent. So I decided that no-one should count on one interpretation or the other (when writing MEI data), and one should instead be explicit about writing @dots.ges. So I modified my music21 MEI writer (soon to be released, I hope) and iohumdrum.cpp to always be explicit about writing @dots.ges.

To be extremely clear, what I am doing is choosing (in the presence of @dur.ges) to write @dots.ges, even when it is exactly the same as @dots, and even when it is "0".

@gregchapman-dev
Copy link
Contributor Author

gregchapman-dev commented Nov 5, 2023

The discussion on MEI slack is here.

Screenshot 2023-11-05 at 11 56 00 Screenshot 2023-11-05 at 11 58 17 Screenshot 2023-11-05 at 11 58 32 Screenshot 2023-11-05 at 12 00 14 Screenshot 2023-11-05 at 12 01 18 Screenshot 2023-11-05 at 12 01 45

Related verovio issue: #757

Somewhat related (durations of notes when different from chord): #1917

@craigsapp
Copy link
Contributor

To be extremely clear, what I am doing is choosing (in the presence of @dur.ges) to write @dots.ges, even when it is exactly the same as @dots, and even when it is "0".

So to summarize your summarization: If @dur.ges is present, then always give @dots.ges explicitly if @dots is present. By extension do not assume that @dur.ges will use @dots, and in any case prevent verovio from doing so by giving @dots.ges if both @dur.ges and @dots are present.

This is OK with me if it is OK with @lpugin.

This new system should not change the current rendering with verovio in any case.

@gregchapman-dev
Copy link
Contributor Author

gregchapman-dev commented Nov 6, 2023

If @dur.ges is present, then I am actually giving @dots.ges whether or not @dots is present. If I know for sure both are "0" I will leave them both out.

@craigsapp
Copy link
Contributor

Yes, that is what I was thinking.

@craigsapp craigsapp self-requested a review November 6, 2023 02:58
@gregchapman-dev
Copy link
Contributor Author

I see a thumbs-up from Laurent above.

@craigsapp craigsapp merged commit 6f73f7a into rism-digital:develop-humdrum Nov 6, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants