Skip to content
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

Extend import of key signatures #3487

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/iomusxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,10 @@ KeySig *MusicXmlInput::ConvertKey(const pugi::xml_node &key)
if (std::strncmp(keyStep.next_sibling().next_sibling().name(), "key-accidental", 14) == 0) {
keyAccid->SetAccid(
ConvertAccidentalToAccid(keyStep.next_sibling().next_sibling().text().as_string()));
keyAccid->SetGlyphName(keyStep.next_sibling().next_sibling().attribute("smufl").as_string());
}
else if (!keyAccid->HasAccid()) {
LogWarning("MusicXML import: Could not properly set keyAccid");
}
}
keySig->AddChild(keyAccid);
Expand Down Expand Up @@ -4011,7 +4015,7 @@ curvature_CURVEDIR MusicXmlInput::CombineCurvedir(curvature_CURVEDIR startDir, c

data_ACCIDENTAL_WRITTEN MusicXmlInput::ConvertAccidentalToAccid(const std::string &value)
{
static const std::map<std::string, data_ACCIDENTAL_WRITTEN> Accidental2Accid{
static const std::map<std::string, data_ACCIDENTAL_WRITTEN> Accidental2Accid{ //
{ "sharp", ACCIDENTAL_WRITTEN_s }, //
{ "natural", ACCIDENTAL_WRITTEN_n }, //
{ "flat", ACCIDENTAL_WRITTEN_f }, //
Expand All @@ -4030,12 +4034,19 @@ data_ACCIDENTAL_WRITTEN MusicXmlInput::ConvertAccidentalToAccid(const std::strin
{ "natural-up", ACCIDENTAL_WRITTEN_nu }, //
{ "flat-down", ACCIDENTAL_WRITTEN_fd }, //
{ "flat-up", ACCIDENTAL_WRITTEN_fu }, //
// { "double-sharp-down", }, //
// { "double-sharp-up", }, //
// { "flat-flat-down", }, //
// { "flat-flat-up", }, //
{ "triple-sharp", ACCIDENTAL_WRITTEN_ts }, //
{ "triple-flat", ACCIDENTAL_WRITTEN_tf }, //
{ "slash-quarter-sharp", ACCIDENTAL_WRITTEN_bms }, //
{ "slash-sharp", ACCIDENTAL_WRITTEN_ks }, //
{ "slash-flat", ACCIDENTAL_WRITTEN_bf }, //
{ "double-slash-flat", ACCIDENTAL_WRITTEN_bmf } //
{ "double-slash-flat", ACCIDENTAL_WRITTEN_bmf }, //
{ "sori", ACCIDENTAL_WRITTEN_sori }, //
{ "koron", ACCIDENTAL_WRITTEN_koron }, //
{ "other", ACCIDENTAL_WRITTEN_NONE }
};

const auto result = Accidental2Accid.find(value);
Expand Down Expand Up @@ -4068,7 +4079,6 @@ data_ACCIDENTAL_GESTURAL MusicXmlInput::ConvertAlterToAccid(const float value)
return result->second;
}

LogWarning("MusicXML import: Unsupported alter value '%.1f'", value);
return ACCIDENTAL_GESTURAL_NONE;
}

Expand Down
Loading