Skip to content

Commit

Permalink
Fix GH#23499: Remove extra treatment for tab pitch in MusicXML export
Browse files Browse the repository at this point in the history
Backport of musescore#25594
  • Loading branch information
rettinghaus authored and Jojo-Schmitz committed Nov 25, 2024
1 parent 44ea622 commit fc89db4
Showing 1 changed file with 4 additions and 31 deletions.
35 changes: 4 additions & 31 deletions importexport/musicxml/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1539,25 +1539,6 @@ static void midipitch2xml(int pitch, char& c, int& alter, int& octave)
//qDebug("midipitch2xml(pitch %d) step %c, alter %d, octave %d", pitch, c, alter, octave);
}

//---------------------------------------------------------
// tabpitch2xml
//---------------------------------------------------------

static void tabpitch2xml(const int pitch, const int tpc, QString& s, int& alter, int& octave)
{
s = tpc2stepName(tpc);
alter = tpc2alterByKey(tpc, Key::C);
octave = (pitch - alter) / 12 - 1;
if (alter < -2 || 2 < alter)
qDebug("tabpitch2xml(pitch %d, tpc %d) problem: step %s, alter %d, octave %d",
pitch, tpc, qPrintable(s), alter, octave);
/*
else
qDebug("tabpitch2xml(pitch %d, tpc %d) step %s, alter %d, octave %d",
pitch, tpc, qPrintable(s), alter, octave);
*/
}

//---------------------------------------------------------
// pitch2xml
//---------------------------------------------------------
Expand Down Expand Up @@ -3818,18 +3799,10 @@ static void writePitch(XmlWriter& xml, const Note* const note, const bool useDru
QString step;
int alter = 0;
int octave = 0;
const Chord* chord = note->chord();
if (chord->staff() && chord->staff()->isTabStaff(Fraction(0,1))) {
tabpitch2xml(note->pitch(), note->tpc(), step, alter, octave);
}
else {
if (!useDrumset) {
pitch2xml(note, step, alter, octave);
}
else {
unpitch2xml(note, step, octave);
}
}
if (!useDrumset)
pitch2xml(note, step, alter, octave);
else
unpitch2xml(note, step, octave);
xml.stag(useDrumset ? "unpitched" : "pitch");
xml.tag(useDrumset ? "display-step" : "step", step);
// Check for microtonal accidentals and overwrite "alter" tag
Expand Down

0 comments on commit fc89db4

Please sign in to comment.