rism-digital / verovio

🎵 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)
https://www.verovio.org
GNU Lesser General Public License v3.0
679 stars 185 forks source link

Incorrect data in generated timemap #3598

Open yucongj opened 8 months ago

yucongj commented 8 months ago

Describe the problem In the timemap generated by verovio, some notes (in Measure 12) are put in the wrong place.

To Reproduce Steps to reproduce the behavior:

  1. Got to https://musescore.com/user/24069/scores/4910730 and download the score in the MuseScore format.
  2. Open the score in MuseScore 4.2.x and export it to an MEI file.
  3. Generate its timemap.

Expected behavior According to the score, at the very beginning of Measure 12, there should be exactly three off-notes and three on-notes. However, in the timemap, there are six off-notes and six on-notes. By looking at their ids, the three extra off/on notes are the three grace notes in that same measure. Below is the beginning of Measure 12 in the timemap, where "n1kprscb", "nf1c3vp", and "nn01drz" are the extra notes that should not be there.

    {
        "measureOn": "m17s861d",
        "off": [
            "nmco2ye",
            "n1tn1tpx",
            "n1hbs9iw",
            "n1kprscb",
            "nf1c3vp",
            "nn01drz" 
        ],
        "on": [
            "n19m14en",
            "nh04th7",
            "n1kprscb",
            "nf1c3vp",
            "nn01drz",
            "n15q7vp6" 
        ],
        "qstamp": 33,
        "tstamp": 47143 
    },

Input data See "To Reproduce" above.

Verovio information Version of Verovio: 4.1.0-dev

Environment information (as appropriate) OS: MacOS 14.3

Screenshots One of the grace notes is highlighted here: Screenshot 2024-02-14 at 8 31 30 PM

Additional context NA

craigsapp commented 8 months ago

Here is an alternate encoding of that measure:

Screenshot 2024-02-14 at 12 44 23
Click to view MEI data above example. ```xml </titleStmt> <pubStmt> </pubStmt> </fileDesc> <encodingDesc> <appInfo> <application isodate="2024-02-14T12:43:21" version="4.2.0-dev-f8e270e-dirty"> <name>Verovio</name> <p>Transcoded from Humdrum</p> </application> </appInfo> </encodingDesc> </meiHead> <music decls="#work0_encoded"> <body> <mdiv xml:id="mmu5xf7"> <score xml:id="s1lmob9k"> <scoreDef xml:id="s18ybh9z" midi.bpm="30.000000"> <staffGrp xml:id="s1qc8rpy" bar.thru="true" symbol="brace"> <label xml:id="ldrhetj">Pno.</label> <staffDef xml:id="staffdef-L1F2" n="1" lines="5"> <clef xml:id="c1pt6csd" shape="G" line="2" /> <keySig xml:id="keysig-L4F2" sig="5f" /> </staffDef> <staffDef xml:id="staffdef-L1F1" n="2" lines="5"> <clef xml:id="ctr0im9" shape="F" line="4" /> <keySig xml:id="keysig-L4F1" sig="5f" /> </staffDef> </staffGrp> </scoreDef> <section xml:id="section-L1F1"> <measure xml:id="measure-L1" n="12"> <staff xml:id="staff-L1F2" n="1"> <layer xml:id="layer-L1F2N1" n="1"> <beam xml:id="beam-L9F2-L15F2"> <chord xml:id="chord-L9F2" dur="8"> <note xml:id="note-L9F2S1" oct="5" pname="d" accid.ges="f" /> <note xml:id="note-L9F2S2" oct="5" pname="f" accid.ges="n" /> </chord> <chord xml:id="chord-L11F2" dots="1" dur="8"> <note xml:id="note-L11F2S1" oct="5" pname="e" accid.ges="f" /> <note xml:id="note-L11F2S2" oct="5" pname="g"> <accid xml:id="accid-L11F2S2" accid="f" func="caution" /> </note> <artic xml:id="artic-L11F2" artic="acc" /> </chord> <chord xml:id="chord-L15F2" dur="16"> <note xml:id="note-L15F2S1" oct="4" pname="b" accid.ges="f" /> <note xml:id="note-L15F2S2" oct="5" pname="d" accid.ges="f" /> </chord> </beam> <chord xml:id="chord-L16F2" dur="8" grace="acc"> <note xml:id="note-L16F2S1" oct="4" pname="b" accid.ges="f" /> <note xml:id="note-L16F2S2" oct="5" pname="d" accid.ges="f" /> </chord> <beam xml:id="beam-L19F2-L21F2"> <chord xml:id="chord-L19F2" dots="1" dur="16"> <note xml:id="note-L19F2S1" oct="5" pname="d" accid.ges="f" /> <note xml:id="note-L19F2S2" oct="5" pname="f" accid.ges="n" /> </chord> <chord xml:id="chord-L21F2" dur="32"> <note xml:id="note-L21F2S1" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L21F2S2" oct="5" pname="e" accid.ges="f" /> </chord> </beam> <note xml:id="note-L22F2" dur="8" oct="5" pname="f" grace="acc" accid.ges="n" /> <tuplet xml:id="tuplet-L23F2-L26F2" num="3" numbase="2" bracket.visible="false" num.format="count"> <beam xml:id="beam-L23F2-L26F2"> <chord xml:id="chord-L23F2" dur="16"> <note xml:id="note-L23F2S1" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L23F2S2" oct="5" pname="e" accid.ges="f" /> </chord> <chord xml:id="chord-L24F2" dur="16"> <note xml:id="note-L24F2S1" oct="4" pname="b" accid.ges="f" /> <note xml:id="note-L24F2S2" oct="5" pname="d" accid.ges="f" /> </chord> <chord xml:id="chord-L26F2" dur="16"> <note xml:id="note-L26F2S1" oct="5" pname="c" accid.ges="n" /> <note xml:id="note-L26F2S2" oct="5" pname="e" accid.ges="f" /> </chord> </beam> </tuplet> <beam xml:id="beam-L27F2-L30F2"> <chord xml:id="chord-L27F2" dur="16"> <note xml:id="note-L27F2S1" oct="5" pname="d" accid.ges="f" /> <note xml:id="note-L27F2S2" oct="5" pname="f" accid.ges="n" /> </chord> <rest xml:id="rest-L29F2" dur="32" /> <chord xml:id="chord-L30F2" dur="32"> <note xml:id="note-L30F2S1" oct="4" pname="a" accid="n" /> <note xml:id="note-L30F2S2" oct="5" pname="c" accid.ges="n" /> </chord> </beam> </layer> </staff> <staff xml:id="staff-L1F1" n="2"> <layer xml:id="layer-L1F1N1" n="1"> <beam xml:id="beam-L9F1-L15F1"> <note xml:id="note-L9F1" dur="16" oct="2" pname="b" accid.ges="f" /> <note xml:id="note-L10F1" dur="16" oct="4" pname="f" accid.ges="n" /> <note xml:id="note-L11F1" dur="16" oct="3" pname="b" accid.ges="f" /> <note xml:id="note-L12F1" dur="16" oct="4" pname="f" accid.ges="n" /> <note xml:id="note-L13F1" dur="16" oct="4" pname="d" accid.ges="f" /> <note xml:id="note-L15F1" dur="16" oct="3" pname="f" accid.ges="n" /> </beam> <beam xml:id="beam-L19F1-L29F1"> <note xml:id="note-L19F1" dur="16" oct="2" pname="b" accid.ges="f" /> <note xml:id="note-L20F1" dur="16" oct="4" pname="f" accid.ges="n" /> <note xml:id="note-L23F1" dur="16" oct="3" pname="a" accid="n" /> <note xml:id="note-L25F1" dur="16" oct="4" pname="f" accid.ges="n" /> <note xml:id="note-L27F1" dur="16" oct="4" pname="e" accid.ges="f" /> <note xml:id="note-L29F1" dur="16" oct="3" pname="f" accid.ges="n" /> </beam> </layer> </staff> <dynam xml:id="dynam-L9F3" place="below" staff="2" tstamp="1.000000">ppp</dynam> <dynam xml:id="dynam-L19F3" place="below" staff="2" tstamp="2.500000">ppp</dynam> <pedal xml:id="pedal-L7F1" staff="2" tstamp="1.000000" dir="down" vgrp="200" /> <pedal xml:id="pedal-L14F1" staff="2" tstamp="2.250000" dir="up" vgrp="200" /> <pedal xml:id="pedal-L17F1" staff="2" tstamp="2.500000" dir="down" vgrp="200" /> <pedal xml:id="pedal-L28F1" staff="2" tstamp="3.750000" dir="up" vgrp="200" /> </measure> </section> </score> </mdiv> </body> </music> </mei> ``` </details> <p>When I convert to MIDI, it is playing properly (in Javascript on VHV).</p> <p>Converting to a timemap (on the command-line):</p> <pre><code class="language-bash">verovio -t timemap test.mei</code></pre> <details> <summary> Click to view timemap </summary> ```json [ { "off": [ "note-L16F2S1", "note-L16F2S2" ], "on": [ "note-L9F2S1", "note-L9F2S2", "note-L16F2S1", "note-L16F2S2", "note-L9F1" ], "qstamp": 0, "tempo": "30.000000", "tstamp": 0 }, { "off": [ "note-L9F1" ], "on": [ "note-L10F1" ], "qstamp": 0.25, "tstamp": 500 }, { "off": [ "note-L9F2S1", "note-L9F2S2", "note-L10F1" ], "on": [ "note-L11F2S1", "note-L11F2S2", "note-L11F1" ], "qstamp": 0.5, "tstamp": 1000 }, { "off": [ "note-L11F1" ], "on": [ "note-L12F1" ], "qstamp": 0.75, "tstamp": 1500 }, { "off": [ "note-L12F1" ], "on": [ "note-L13F1" ], "qstamp": 1, "tstamp": 2000 }, { "off": [ "note-L11F2S1", "note-L11F2S2", "note-L13F1" ], "on": [ "note-L15F2S1", "note-L15F2S2", "note-L15F1" ], "qstamp": 1.25, "tstamp": 2500 }, { "off": [ "note-L15F2S1", "note-L15F2S2", "note-L15F1" ], "on": [ "note-L19F2S1", "note-L19F2S2", "note-L19F1" ], "qstamp": 1.5, "tstamp": 3000 }, { "off": [ "note-L19F1" ], "on": [ "note-L20F1" ], "qstamp": 1.75, "tstamp": 3500 }, { "off": [ "note-L19F2S1", "note-L19F2S2" ], "on": [ "note-L21F2S1", "note-L21F2S2" ], "qstamp": 1.875, "tstamp": 3750 }, { "off": [ "note-L21F2S1", "note-L21F2S2", "note-L20F1" ], "on": [ "note-L23F2S1", "note-L23F2S2", "note-L23F1" ], "qstamp": 2, "tstamp": 4000 }, { "off": [ "note-L23F2S1", "note-L23F2S2" ], "on": [ "note-L24F2S1", "note-L24F2S2" ], "qstamp": 2.166666666666667, "tstamp": 4333 }, { "off": [ "note-L23F1" ], "on": [ "note-L25F1" ], "qstamp": 2.25, "tstamp": 4500 }, { "off": [ "note-L24F2S1", "note-L24F2S2" ], "on": [ "note-L26F2S1", "note-L26F2S2" ], "qstamp": 2.333333333333333, "tstamp": 4667 }, { "off": [ "note-L26F2S1", "note-L26F2S2", "note-L25F1" ], "on": [ "note-L27F2S1", "note-L27F2S2", "note-L27F1" ], "qstamp": 2.5, "tstamp": 5000 }, { "off": [ "note-L27F2S1", "note-L27F2S2", "note-L27F1" ], "on": [ "note-L29F1" ], "qstamp": 2.75, "tstamp": 5500 }, { "on": [ "note-L30F2S1", "note-L30F2S2" ], "qstamp": 2.875, "tstamp": 5750 }, { "off": [ "note-L30F2S1", "note-L30F2S2", "note-L29F1" ], "qstamp": 3, "tstamp": 6000 } ] ``` </details> <p>First event entry for the measure:</p> <pre><code class="language-json"> { "off": [ "note-L16F2S1", <- Grace note (should not be here, should be at qstamp 1.5) "note-L16F2S2" <- Grace note (should not be here, should be at qstamp 1.5) ], "on": [ "note-L9F2S1", "note-L9F2S2", "note-L16F2S1", <-Grace note (should not be here, should be at qstamp 1.5) "note-L16F2S2", <- Grace note (should not be here, should be at qstamp 1.5) "note-L9F1" ], "qstamp": 0, "tempo": "30.000000", "tstamp": 0 },</code></pre> <p>Checking the MIDI rendering:</p> <pre><code class="language-bash">verovio -t midi file.mei</code></pre> <p>I do not see any zero-duration grace notes at the start of the music (which probably would not sound).</p> <p>The grace note chord is not duplicated in the time map, so they are not being encoded twice.</p> <p>This is strange since the timemap is calculated before the MIDI file generation, and used to create the MIDI file.</p> <p>Somehow it might be related to the timemap generating Functor. (I calculated the MIDI and timemap files on the command line). It would be useful to know what toolkit version you are using for verovio, probably the C++ library if you are loading directly into Qt? Or do you prepare the timemap in some other way?</p> <p>A strange thing I note is that your <code>ppp</code> is spaced as <code>p pp</code>. This might indicate an older version of verovio is being used, although I am also getting the timemap problem with the most recent version of verovio.</p> <hr /> <p>Also the third grace note (note-L22F2) from the MEI data is not found in the timemap...</p> </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>