musescore / musescore/MuseScore

MEI import and export: Hairpins cannot extend beyond the last note or rest of a bar

Open
#20,917 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

community MEI
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

Import/export issue

Bug description

When exporting to MEI, hairpins extending to the end of a bar get an @endid referring to the last note or rest, meaning they will end at that element when rendered in other applications. They should use @tstamp2 referring to the end of the bar instead.
The other way around, when importing MEI to MuseScore, hairpins with a @tstamp2 pointing beyond the last note/rest element will raise an error and are not rendered correctly in MuseScore.
This may be a general problem with line-like elements, and the import aspect of it may partly be implied by the disclaimer at https://music-encoding.org/musescore-doc/docs/features/dynamics.html, stating that

Import of dynamic encoded with @tstamp attribute is also supported, even though these will not be preserved. Only dynamics for which a chord, note, or rest corresponding to the @tstamp can be found will be imported.

Steps to reproduce
  1. Create a score with a hairpin extending to the end of a bar
  2. Export to MEI
  3. View MEI rendering in Verovio: Hairpin ends at the last note/rest of the bar
Screenshots/Screen recordings

MuseScore:
hairpin_in_musescore
Verovio:
hairpin_exported_to_mei

MuseScore Version

4.2.0-233521124

Regression

I don't know

Operating system

Windows 10

Additional context

Exported MEI (first bar only):

<measure xml:id="mvm2upn" n="1">
   <staff xml:id="m1s1" n="1">
      <layer xml:id="m1s1l1" n="1">
         <note xml:id="nwzlpzr" dur="2" pname="g" oct="4" />
         <note xml:id="nadw3an" dur="2" pname="g" oct="4" />
      </layer>
   </staff>
   <hairpin xml:id="h1dpcglf" form="dim" startid="#nwzlpzr" endid="#nadw3an" />
</measure>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by exporting a score with a hairpin reaching the end of a bar, then inspect the MEI import/export handling for hairpins and related line-like elements. Done means export uses @tstamp2 for the bar end and import accepts such timestamps without errors or incorrect rendering; verify the result in Verovio and MuseScore.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.