Skip to content

Commit

Permalink
fix #286207: single-note dynamics: fortepianos that last longer than …
Browse files Browse the repository at this point in the history
…a segment play incorrectly
  • Loading branch information
jthistle committed Mar 17, 2019
1 parent a9df4a0 commit 9340d68
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libmscore/rendermidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,16 @@ static void collectMeasureEventsDefault(EventMap* events, Measure* m, Staff* sta
else if (h->isDecrescendo() && hairpinStartVel < velocityEnd)
singleNoteDynamics = false;
}
else {
if (velocityMiddle != -1 && velocityEnd > velocityMiddle) {
// HACK
// On the fly, update the staff velocity so that we have the
// correct start velocity for the next segment
// We reach this point when a changing dynamic lasts longer than this chord's segment
staff->velocities().setVelo(etick.ticks(), velocityMiddle);
velocityEnd = velocityMiddle;
}
}

// Check for articulations
bool hasArticulations = false;
Expand Down Expand Up @@ -1175,15 +1185,15 @@ void Score::updateVelo()
for (int i = partStaff; i < partStaff+partStaves; ++i) {
staff(i)->velocities().setVelo(tick.ticks(), v);
if (v2 > 0)
velo.setVelo(tick2.ticks(), v2);
staff(i)->velocities().setVelo(tick2.ticks(), v2);
}
}
break;
case Dynamic::Range::SYSTEM:
for (int i = 0; i < nstaves(); ++i) {
staff(i)->velocities().setVelo(tick.ticks(), v);
if (v2 > 0)
velo.setVelo(tick2.ticks(), v2);
staff(i)->velocities().setVelo(tick2.ticks(), v2);
}
break;
}
Expand Down

0 comments on commit 9340d68

Please sign in to comment.