-
Notifications
You must be signed in to change notification settings - Fork 433
Add MusicXML sound tag parsing (fix #1578) #1579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mscuthbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! This is a huge improvement. Thank you! I had no idea there were so many XML files with tempos specified in <sound> elements but without metronomes. I'm going to close and re-open to see if there are any conflicts with the stripTies bug fix.
|
Indeed - - the typing did catch a minor bug and added a warning that something that appeared typed was not. Thanks for being totally on top of this! |
Import tempo as int if possible, allowing better braille display of metronomes
removed a `<sound tempo="0">` tag in schoenberg/opus19 to fix warnings
|
A file in the corpus (schoenberg/opus19) had an incorrect tag, I have removed it. |
|
It also just looks more musical to see qtr=144 than 144.0, and |
|
Sorry for the delay in merging -- I just needed to check out the Schoenberg file and make sure all was good. |
|
I'm changing this a little bit in the next PR because I'm seeing phantom metronome marks in lots of pieces that should not show them in scores (like medieval/Renaissance music, Bach Chorales, etc.) -- these only set numberSounding so that the metronome mark does not appear in the score, just affecting playback. |
Not used in the implementation from #1579
This PR adds functionality to parse
<sound tempo='x'>tags from MusicXML files into MetronomeMark objects (fixing #1578).bach/bwv66.6contains such a<sound tempo='x'>tag and is heavily used in doctests. Therefore a lot of tests had to be updated, leading to quite a lot of changes, however nothing seems to be broken.The only tests that had significantly different outputs are related to feature extraction.
They change because the changed tempo leads to a (very) different beat histogram.
Previously, the tempo was 120bpm, leading to beat bpm values of 60, 120, 240, where 240 was discarded due to the this line:
music21/music21/features/base.py
Line 504 in acf926c
The accurate tempo is 96, so the values are 48, 96, 192 and are therefore no longer discarded.
Let me know what you think!