musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.08k stars 2.6k forks source link

MEI Export: identify repeated sections and put them inside of <section> </section> #21275

Open yucongj opened 7 months ago

yucongj commented 7 months ago

Your idea

Currently in exported MEI files, repeated sections are not inside of <section>s. For example, the MEI file exported from this score (containing two repeats, at Measures 28 and 73) only has the one <section> from the start to the end. It would be good to place repeated measures inside of individual<section>s with xml ids, so that (e.g.,) the exported MEI of the above score would have the structure below:

           <section xml:id="section_allegro">
              <section xml:id="section_A_m1-28">
              ...
              </section>
              <section xml:id="section_B_m29-73">
              ...
              </section>
           </section>

pinging @lpugin

Problem to be solved

After such <section>s are included, it'd be easy to add <expansion> for scores with repeats, which can be used to create expansionmap etc. For example, it would then be easy for anyone to add <expansion> to specify the sequence of sections in actual music performance:

           <section xml:id="section_allegro">
              <expansion plist="#section_A_m1-28 #section_A_m1-28 #section_B_m29-73 #section_B_m29-73" xml:id="expansion-maximum"/> 
              <section xml:id="section_A_m1-28">
              ...
              </section>
              <section xml:id="section_B_m29-73">
              ...
              </section>
           </section>

Prior art

No response

Additional context

No response

rettinghaus commented 7 months ago

Without the expansion element available in MEI Basic I don't see this as a big improvement. If you're going to process the file anyway to add an expansion, why won't you add missing section elements automatically?

bkunda commented 7 months ago

@shoogle pls have a look at this request and triage accordingly. Thank you!

yucongj commented 7 months ago

"Adding missing section elements automatically" is not an easy thing to do for most users, while adding the <expansion> manually is extremely easy if these <section>s are properly created already.

One significant value of being able to export MEI files from MuseScore is that it increases the amount of MEI files useful for various music applications. Given that repeats are extremely common in CMN, I can imagine having these sections created could enable even more (and more diverse) applications/projects, including the ones that consider actual music performances (e.g., playing back scores, audio-to-score alignments, etc.).