Skip to content

Commit

Permalink
basic check for roman numerals
Browse files Browse the repository at this point in the history
  • Loading branch information
rettinghaus committed Aug 29, 2024
1 parent 15c137f commit 11f0159
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/importexport/musicxml/internal/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7356,9 +7356,14 @@ void MusicXMLParserPass2::harmony(const String& partId, Measure* measure, const
if (m_e.name() == "numeral-root") {
String numeralRoot = m_e.readText();
String numeralRootText = m_e.attribute("text");
// TODO analyze text and import as roman numerals
ha->setHarmonyType(HarmonyType::NASHVILLE);
ha->setFunction(numeralRoot);
static const std::regex roman("[iv]+|[IV]+");
if (std::regex_match(numeralRootText.toStdString(), roman)) {
ha->setHarmonyType(HarmonyType::ROMAN);
functionText = numeralRootText;
} else {
ha->setHarmonyType(HarmonyType::NASHVILLE);
ha->setFunction(numeralRoot);
}
} else if (m_e.name() == "numeral-alter") {
const int alter = m_e.readText().toInt();
switch (alter) {
Expand Down

0 comments on commit 11f0159

Please sign in to comment.