-
Notifications
You must be signed in to change notification settings - Fork 8
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
[musicxml2hum] Missing exclusive interpretations and wrong order #85
Comments
I don't (yet) have the original Dorico file (and I haven't installed it either). A music theory professor friend of mine provided me with the MusicXML files. Sadly the Dorico MusicXML export does not include fermatas. However here is a screenshot of the scan of the print: ![]() On IMSLP they don't have the version with the middle voices included: https://imslp.org/wiki/Special:ReverseLookup/668808 Your screenshot from Verovio and MuseScore looks good, except for the figured bass numbers. But I cannot guarantee that they are perfectly encoded in the MusicXML file. I will probably proofread everything and add the fermatas (and probably also the odd trills) once I have it in Humdrum. |
This is caused by this transposition instruction in the Tenor part: <transpose number="1">
<diatonic>0</diatonic>
<chromatic>0</chromatic>
<octave-change>-1</octave-change>
</transpose> The Use of an octave transposition for displaying on C4 clef is unusual and may be a bug in the MusicXML export from Dorico, or a subtle bug related to starting with a vocal tenor clef and then changing the clef to C4 (Sibelius can have buggy vocal tenor clef output depending on how you create the clef, for example). Note that Dorico developers were previously Sibelius developers and speculate as to why the bugs seem to be related. The transposition instruction should be The octave down transposition needs to be applied to the notes in the Humdrum output (store notes at souding pitch in Humdrum scores is highly preferred), and then When this happens in Sibelius files, I used the transpose filter in VHV with the
Meaning: transpose spine 6 down an octave. |
I just updated the output on my initial post. I accidentally posted a version where I had removed the |
This was a perfect use case to debug it with 24db155#diff-c557cf502a627b7aab49de8d3977a3473cca135e87b0bcf353bafc289b331348L132-L133 For now I just reverted this change, but you probably had a reason to change this line. Will I break something else if I revert this change? |
Thanks for tracking the problem down! (I will also have to familiarize myself with The problem as you note is this line changed two months ago: Lines 134 to 135 in 24db155
Notice that I kept the previous code as a comment since I was not totally certain about the ramifications of changing the code. What this line of code does is infer the number of staves in the part by looking at the data line at the start of the first measure in the score, which is causing a problem somehow. Perhaps the information such as the clef, time signature, and key signature are not assigned explicitly to staves 1 and 2, so they are stored only in the first staff, resulting in the current algorithm only seeing a single staff rather than two. Looking at the data, this does not seem to be the case since there are clearly two staves of information in the <attributes>
<divisions>4</divisions>
<key number="1">
<fifths>0</fifths>
<mode>none</mode>
</key>
<key number="2">
<fifths>0</fifths>
<mode>none</mode>
</key>
<time symbol="common">
<beats>4</beats>
<beat-type>4</beat-type>
</time>
<staves>2</staves>
<clef number="1">
<sign>C</sign>
<line>1</line>
</clef>
<clef number="2">
<sign>F</sign>
<line>4</line>
</clef>
</attributes> Loading from Musescore output has the same problem with staff assignments for key and time needing to be inferred from <divisions>1</divisions>
<key>
<fifths>0</fifths>
<mode>none</mode>
</key>
<time symbol="common">
<beats>4</beats>
<beat-type>4</beat-type>
</time>
<staves>2</staves>
<clef number="1">
<sign>C</sign>
<line>1</line>
</clef>
<clef number="2">
<sign>F</sign>
<line>4</line>
</clef>
</attributes> Here are some notes on the HumGrid class: HumGrid is a vector of GridMeasure* is a vector of GridSlice* is a vector of GridPart* is a vector of GridStaff* (and GridSide). With GridStaff being a vector of GridVoice* (and GridSide). GridSide is for tandem spines of non-kern data such as harmony, lyrics, figured bass, chords, etc. There is a GridSide for the system (primarily for harmony) and a GridSide for each staff. GridSlice is analogous to a HumdrumLine. GridPart is not directly represented in Humdrum spines, as I prefer to make each staff a separate spine. This is similar to MEI but not to MusicXML. I instead use **kern
*part1
*^
*staff2 *staff1
=1 =1
1c 1c
= =
*v *v
*- but I find that a bother to deal with piano music and tools such as The HumGrid class was created specifically to convert from MusicXML into Humdrum (but should be useful to convert from other data types into Humdrum). It is an intermediary step that does not deal with spine manipulations until after the MusicXML content has been loaded. It also manages creation of null data tokens as part of the process to generate a Humdrum file. The In English(ish), this line: return (int)this->at(0)->front()->at(partindex)->size(); means "return the size of the staff vector for the given part from the first slice of the first measure" while the previous method: return (int)this->at(0)->back()->at(partindex)->size(); means "return the size of the staff vector for the given part from the last slide of the first measure" This second version was failing due in cases where there is a global comment at the end of the first measure, such as: **kern **kern
*part1 *part1
*staff2 *staff1
=1 =1
1c 1c
!!linebreak: original
= =
*- *- Where I add a comment at the end of a measure if there is a system break after that measure. The problem is that if the first measure contains a comment at the end of the measure, then there is only one "staff" for this line. I therefore thought that looking instead at the first entry in the measure would be better (but obviously not). I will use your pull request to revert to looking at the back, but then generalize the code to skip non-spine GridSlice line types by iterating backwards in the GridSlices in the measure until I find data or otherwise the maximum staff count for interpretation/local comment slices. A more ideal solution would probably to have a state variable for GridPart that stores the maximum staff index of inserted data in all GridMeasure/GridSlice for each GridPart. This would have to be stored in the HumGrid level since the GridPart is embedded within the GridMeasure/GridSlice vectors. But the algorithm in the previous paragraph should work unless (1) there is no data in the first measure, or (2) for some reason only notes/rests are given for only one staff in the first measure. |
Thank you for the detailed explanation. It will be of great use when I try to solve some problems with the import of the Schiørring chorales. Especially with the first piano system with the full harmony example (part 5) there were some problems with the rhythm. Also stem directions seem to be incorrect which might be a bad encoding in Dorico or a bad export to MusicXML. I'm not sure yet if the problem for all this is I fixed this manually for the first 3 chorales, but it is too time consuming for all 100, so I hope I can solve this by improving the Here is the link to the repository: https://github.com/WolfgangDrescher/schiorring-choral-bog. Keep in mind that repo is heavily work in progress and probably most chorales will still fail to render in Verovio because of invalid humdrum files (except the first 3 and some files that are correct "by accident"). |
This is my source file: Schiorring - 01 Ach! Herre from.mxl.zip
Click to see the output of
musicxml2hum
musicxml2hum
fails to convert it to a valid humdrum file and I observed several problems:cc
missing in Piano 1 and it seems like the notes of the spine splits are arranged in the wrong order (high notes in left spine, low note in right spine). This only seems to be a problem for the first line.**fb
spine is included but the data and the corresponding exclusive interpretations are swapped. Compare 2nd and 3rd and spine. (Note that in the source score the piano 2 has the figured bass numbers semantically assigned to the wrong system (right hand), I would rearrange this withextractxx
later on and bind them to the left hand system and use*above
instead.)Trd0c0
?system-decoration
should probably put brackets around the piano parts.I will try to improve this as much as possible on my own, but tips for a good implementation would be helpful, since I have not yet familiarized myself with
musicxml2hum
.The text was updated successfully, but these errors were encountered: