Skip to content

Commit

Permalink
Fix MusicXML <wedge> spread handling
Browse files Browse the repository at this point in the history
Made MusicXmlInput ignore <wedge> spread at the start of a crescendo or
or the end of a diminuendo.
  • Loading branch information
paxbun committed Jun 7, 2023
1 parent cf8aacb commit 9547d8d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/iomusxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2229,10 +2229,12 @@ void MusicXmlInput::ReadMusicXmlDirection(
if (wedge->node().attribute("niente")) {
iter->first->SetNiente(ConvertWordToBool(wedge->node().attribute("niente").as_string()));
}
if (wedge->node().attribute("spread")) {
data_MEASUREMENTSIGNED opening;
opening.SetVu(wedge->node().attribute("spread").as_double() / 5);
iter->first->SetOpening(opening);
if (iter->first->GetForm() == hairpinLog_FORM_cres) {
if (wedge->node().attribute("spread")) {
data_MEASUREMENTSIGNED opening;
opening.SetVu(wedge->node().attribute("spread").as_double() / 5);
iter->first->SetOpening(opening);
}
}
matchedWedge = true;
m_hairpinStack.erase(iter);
Expand All @@ -2252,6 +2254,11 @@ void MusicXmlInput::ReadMusicXmlDirection(
}
else if (HasAttributeWithValue(wedge->node(), "type", "diminuendo")) {
hairpin->SetForm(hairpinLog_FORM_dim);
if (wedge->node().attribute("spread")) {
data_MEASUREMENTSIGNED opening;
opening.SetVu(wedge->node().attribute("spread").as_double() / 5);
hairpin->SetOpening(opening);
}
}
else {
delete hairpin;
Expand Down

0 comments on commit 9547d8d

Please sign in to comment.