CPJKU / partitura

A python package for handling modern staff notation of music
https://partitura.readthedocs.io
Apache License 2.0
243 stars 18 forks source link

bugfix for midi scores with ts only in one track #308

Closed fosfrancesco closed 1 year ago

fosfrancesco commented 1 year ago

Some midi scores, like the one produced by Musescore, have 2 tracks, one for each hand, but time signatures only in one track. The other track is then assumed to be 4/4 and this is completely scrambling the note positions if this is untrue.

Now, if only one track has time signatures, they are shared across all tracks. For the (very very uncommon) case where the midi file maker wanted to have different time signatures for each track, we assume they did specify at least one time signature for each track, so this bugfix won't change anything

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 75.86% and project coverage change: +0.11% :tada:

Comparison is base (5fe996d) 85.13% compared to head (5f18fd8) 85.24%. Report is 1 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #308 +/- ## =========================================== + Coverage 85.13% 85.24% +0.11% =========================================== Files 80 80 Lines 13663 13678 +15 =========================================== + Hits 11632 11660 +28 + Misses 2031 2018 -13 ``` | [Files Changed](https://app.codecov.io/gh/CPJKU/partitura/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU) | Coverage Δ | | |---|---|---| | [partitura/io/musescore.py](https://app.codecov.io/gh/CPJKU/partitura/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU#diff-cGFydGl0dXJhL2lvL211c2VzY29yZS5weQ==) | `27.47% <0.00%> (ø)` | | | [partitura/utils/music.py](https://app.codecov.io/gh/CPJKU/partitura/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU#diff-cGFydGl0dXJhL3V0aWxzL211c2ljLnB5) | `74.20% <ø> (ø)` | | | [partitura/io/importmei.py](https://app.codecov.io/gh/CPJKU/partitura/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU#diff-cGFydGl0dXJhL2lvL2ltcG9ydG1laS5weQ==) | `92.16% <77.77%> (ø)` | | | [partitura/io/importmidi.py](https://app.codecov.io/gh/CPJKU/partitura/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU#diff-cGFydGl0dXJhL2lvL2ltcG9ydG1pZGkucHk=) | `87.50% <100.00%> (+3.55%)` | :arrow_up: | | [tests/\_\_init\_\_.py](https://app.codecov.io/gh/CPJKU/partitura/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU#diff-dGVzdHMvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | | | [tests/test\_midi\_import.py](https://app.codecov.io/gh/CPJKU/partitura/pull/308?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU#diff-dGVzdHMvdGVzdF9taWRpX2ltcG9ydC5weQ==) | `98.91% <100.00%> (+0.04%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/CPJKU/partitura/pull/308/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CPJKU)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.