Skip to content
Permalink
Browse files

fix #282099: backwards melisma with overlapping voices

  • Loading branch information...
MarcSabatella committed Apr 20, 2019
1 parent e6eb405 commit e6743f9f557ec3abc2593f164a96ce75690a3be6
Showing with 27 additions and 2 deletions.
  1. +2 −0 libmscore/lyricsline.cpp
  2. +25 −2 libmscore/spanner.cpp
@@ -155,6 +155,8 @@ void LyricsLine::layout()
}
lyrics()->undoChangeProperty(Pid::LYRIC_TICKS, ps->tick() - lyricsStartTick);
}
// Spanner::computeEndElement() will actually ignore this value and use the (earlier) lyrics()->endTick() instead
// still, for consistency with other lines, we should set the ticks for this to the computed (later) value
setTicks(s->tick() - lyricsStartTick);
}
else { // dash(es)
@@ -20,6 +20,7 @@
#include "measure.h"
#include "undo.h"
#include "staff.h"
#include "lyrics.h"
#include "musescoreCore.h"

namespace Ms {
@@ -596,13 +597,35 @@ void Spanner::computeEndElement()
setTrack2(track());
if (ticks().isZero() && isTextLine() && parent()) // special case palette
setTicks(score()->lastSegment()->tick() - _tick);
// find last cr on this staff that ends before tick2

_endElement = score()->findCRinStaff(tick2(), track2() / VOICES);
if (isLyricsLine()) {
// lyrics endTick should already indicate the segment we want
// except for TEMP_MELISMA_TICKS case
Lyrics* l = toLyricsLine(this)->lyrics();
Fraction tick = (l->ticks().ticks() == Lyrics::TEMP_MELISMA_TICKS) ? l->tick() : l->endTick();
Segment* s = score()->tick2segment(tick, true, SegmentType::ChordRest);
if (!s) {
qDebug("%s no end segment for tick %d", name(), tick);
return;
}
int t = trackZeroVoice(track2());
// take the first chordrest we can find;
// linePos will substitute one in current voice if available
for (int v = 0; v < VOICES; ++v) {
_endElement = s->element(t + v);
if (_endElement)
break;
}
}
else {
// find last cr on this staff that ends before tick2
_endElement = score()->findCRinStaff(tick2(), track2() / VOICES);
}
if (!_endElement) {
qDebug("%s no end element for tick %d", name(), tick2().ticks());
return;
}

if (!endCR()->measure()->isMMRest()) {
ChordRest* cr = endCR();
Fraction nticks = cr->tick() + cr->actualTicks() - _tick;

0 comments on commit e6743f9

Please sign in to comment.
You can’t perform that action at this time.