Skip to content

Commit

Permalink
ENG-71: Infer NmiCmi to N.C.
Browse files Browse the repository at this point in the history
Dolet exports some N.C. chord symbols as a direction with a words
element containing "NmiCmi". This adds a simple inference to handle
that.
  • Loading branch information
iveshenry18 committed Jul 17, 2021
1 parent 083ea55 commit aca2536
Show file tree
Hide file tree
Showing 5 changed files with 1,655 additions and 0 deletions.
21 changes: 21 additions & 0 deletions importexport/musicxml/importmxmlpass2.cpp
Expand Up @@ -2629,6 +2629,7 @@ void MusicXMLParserDirection::direction(const QString& partId,
}

handleRepeats(measure, track, tick + _offset);
handleNmiCmi(measure, track, tick + _offset, delayedDirections);

// fix for Sibelius 7.1.3 (direct export) which creates metronomes without <sound tempo="..."/>:
// if necessary, use the value calculated by metronome()
Expand Down Expand Up @@ -3241,6 +3242,26 @@ void MusicXMLParserDirection::handleRepeats(Measure* measure, const int track, c
}
}

//---------------------------------------------------------
// handleNmiCmi
// Dolet strangely exports N.C. chord symbols as the
// text direction "NmiCmi".
//---------------------------------------------------------

void MusicXMLParserDirection::handleNmiCmi(Measure* measure, const int track, const Fraction tick, DelayedDirectionsList& delayedDirections)
{
if (!_wordsText.contains("NmiCmi"))
return;
Harmony* ha = new Harmony(_score);
ha->setRootTpc(Tpc::TPC_INVALID);
ha->setId(-1);
ha->setTextName("N.C.");
ha->setTrack(track);
MusicXMLDelayedDirectionElement* delayedDirection = new MusicXMLDelayedDirectionElement(totalY(), ha, track, "above", measure, tick);
delayedDirections.push_back(delayedDirection);
_wordsText.replace("NmiCmi", "");
}

//---------------------------------------------------------
// bracket
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions importexport/musicxml/importmxmlpass2.h
Expand Up @@ -397,6 +397,7 @@ class MusicXMLParserDirection {
void sound();
void dynamics();
void handleRepeats(Measure* measure, const int track, const Fraction tick);
void handleNmiCmi(Measure* measure, const int track, const Fraction tick, DelayedDirectionsList& delayedDirections);
QString matchRepeat() const;
bool isLikelyFingering() const;
bool isLikelyCredit(const Fraction& tick) const;
Expand Down

0 comments on commit aca2536

Please sign in to comment.