Skip to content

Commit

Permalink
fix last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Apr 9, 2014
1 parent d280091 commit 4532ce1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,7 @@ Measure* Chord::measure() const

void Chord::sortNotes()
{
printf("Chord::sortNotes\n");
// printf("Chord::sortNotes\n");
std::sort(notes().begin(), notes().end(),
[](const Note* a,const Note* b)->bool { return b->line() < a->line(); }
// [](const Note* a,const Note* b)->bool { return a->pitch() < b->pitch(); }
Expand Down
8 changes: 7 additions & 1 deletion libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ inline int Note::concertPitchIdx() const
void Note::setPitch(int val)
{
_pitch = restrict(val, 0, 127);
#if 0
int pitchOffset = 0;
if (score()) {
Part* part = staff() ? staff()->part() : 0;
Expand All @@ -298,13 +299,16 @@ void Note::setPitch(int val)
if (chord()->measure())
chord()->measure()->updateAccidentals(chord()->staffIdx());
}
#endif
}

void Note::setPitch(int pitch, int tpc1, int tpc2)
{
setPitch(pitch);
Q_ASSERT(tpcIsValid(tpc1));
Q_ASSERT(tpcIsValid(tpc2));
_tpc[0] = tpc1;
_tpc[1] = tpc2;
setPitch(pitch);
}

//---------------------------------------------------------
Expand Down Expand Up @@ -334,6 +338,8 @@ void Note::setTpcFromPitch()
{
_tpc[0] = tpcFromPitch(_pitch);
_tpc[1] = tpcFromPitch(_pitch - transposition());
Q_ASSERT(tpcIsValid(_tpc[0]));
Q_ASSERT(tpcIsValid(_tpc[1]));
}

//---------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions mtest/guitarpro/arpeggio_up_down.gp4-ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -414,20 +414,20 @@
<Chord>
<lid>7</lid>
<durationType>whole</durationType>
<Note>
<lid>8</lid>
<pitch>53</pitch>
<tpc>13</tpc>
<fret>8</fret>
<string>4</string>
</Note>
<Note>
<lid>9</lid>
<pitch>50</pitch>
<tpc>16</tpc>
<fret>0</fret>
<string>3</string>
</Note>
<Note>
<lid>8</lid>
<pitch>53</pitch>
<tpc>13</tpc>
<fret>8</fret>
<string>4</string>
</Note>
<Note>
<lid>10</lid>
<pitch>57</pitch>
Expand Down
Empty file modified mtest/guitarpro/updateReference
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions mtest/musicxml/io/testMeasureLength_ref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
<measure number="2">
<note>
<pitch>
<step>A</step>
<octave>4</octave>
<step>C</step>
<octave>5</octave>
</pitch>
<duration>1</duration>
<voice>1</voice>
Expand All @@ -172,8 +172,8 @@
<note>
<chord/>
<pitch>
<step>C</step>
<octave>5</octave>
<step>A</step>
<octave>4</octave>
</pitch>
<duration>1</duration>
<voice>1</voice>
Expand Down
1 change: 1 addition & 0 deletions mtest/testutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Score* MTest::readCreatedScore(const QString& name)
delete score;
return 0;
}
score->updateNotes();
return score;
}

Expand Down

0 comments on commit 4532ce1

Please sign in to comment.