fix #148131: [MusicXML] import of transposing score with chromatic tag only
This commit is contained in:
parent
7d2efcc9c3
commit
3136cdb49c
1 changed files with 11 additions and 3 deletions
|
@ -3746,13 +3746,18 @@ void MusicXMLParserPass2::transpose(const QString& partId)
|
|||
Q_ASSERT(_e.isStartElement() && _e.name() == "transpose");
|
||||
|
||||
Interval interval;
|
||||
|
||||
bool diatonic = false;
|
||||
bool chromatic = false;
|
||||
while (_e.readNextStartElement()) {
|
||||
int i = _e.readElementText().toInt();
|
||||
if (_e.name() == "diatonic")
|
||||
if (_e.name() == "diatonic") {
|
||||
interval.diatonic = i;
|
||||
else if (_e.name() == "chromatic")
|
||||
diatonic = true;
|
||||
}
|
||||
else if (_e.name() == "chromatic") {
|
||||
interval.chromatic = i;
|
||||
chromatic = true;
|
||||
}
|
||||
else if (_e.name() == "octave-change") {
|
||||
interval.diatonic += i * 7;
|
||||
interval.chromatic += i * 12;
|
||||
|
@ -3761,6 +3766,9 @@ void MusicXMLParserPass2::transpose(const QString& partId)
|
|||
skipLogCurrElem();
|
||||
}
|
||||
|
||||
if (chromatic && !diatonic)
|
||||
interval.diatonic += chromatic2diatonic(interval.chromatic);
|
||||
|
||||
_pass1.getPart(partId)->instrument()->setTranspose(interval);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue