johentsch / ms3

A parser for annotated MuseScore 3 files.
https://ms3.readthedocs.io
GNU General Public License v3.0
41 stars 3 forks source link

The excerpt update #104

Closed leobruneau closed 11 months ago

leobruneau commented 11 months ago

With new updates it is now possible to:

  1. extract different types of excerpts (i.e. phrase endings, full phrases and within phrases)
  2. enforce the tempo on an excerpt (as well as the beat-unit). If not enforced the last active tempo tag will be retrieved
  3. fine-trim excerpts by specifying the exact oneset values for the start and the end of the excerpt. Every note out of range will be transformed into rest
  4. extract an excerpt based on a collection of measures

An ulterior addition is the cleansing of the XML that, during excerpt creation, removes all tags that refer to repeat-like structures to avoid generating "broken" and/or nonsensical excerpts

All the methods have been clearly described within corresponding docstrings

leobruneau commented 11 months ago

Hi @johentsch ! I will address all the points during this week as well as add unittests for the new code

johentsch commented 11 months ago

Thank you. P.S.: I had forgotten to push my merging the main branch. Just pushed the commit, please pull...

leobruneau commented 11 months ago

Hey @johentsch ! All problems should've been addressed as well as unittests added for the methods. I also re-implemented random excerpt generation according to what we had talked about and what is expected within the unittests that you wrote. I think we should be ready to close this pull request and open another one containing the requested changes