Skip to content

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

Merged
CarlosCancino-Chacon merged 1 commit intodevelopfrom
score_midi_bug
Sep 20, 2023
Merged

bugfix for midi scores with ts only in one track#308
CarlosCancino-Chacon merged 1 commit intodevelopfrom
score_midi_bug

Conversation

@fosfrancesco
Copy link
Member

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

…rack. Now this ts is shared between all the tracks
@fosfrancesco fosfrancesco added the bug Something isn't working label Aug 18, 2023
@fosfrancesco fosfrancesco requested a review from sildater August 18, 2023 09:47
@codecov-commenter
Copy link

Codecov Report

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

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
@@             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 Coverage Δ
partitura/io/musescore.py 27.47% <0.00%> (ø)
partitura/utils/music.py 74.20% <ø> (ø)
partitura/io/importmei.py 92.16% <77.77%> (ø)
partitura/io/importmidi.py 87.50% <100.00%> (+3.55%) ⬆️
tests/__init__.py 100.00% <100.00%> (ø)
tests/test_midi_import.py 98.91% <100.00%> (+0.04%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CarlosCancino-Chacon CarlosCancino-Chacon merged commit b821956 into develop Sep 20, 2023
@CarlosCancino-Chacon CarlosCancino-Chacon deleted the score_midi_bug branch September 20, 2023 12:02
@huispaty huispaty mentioned this pull request Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants