Skip to content

Commit

Permalink
Merge pull request #5157 from mattmcclinch/291146-should-render-note
Browse files Browse the repository at this point in the history
fix #291146: Swing prevents midi rendering of tied notes
  • Loading branch information
anatoly-os committed Jul 27, 2019
2 parents 6c79954 + 7c3fef8 commit beb15fa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
24 changes: 24 additions & 0 deletions libmscore/articulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,30 @@ bool Articulation::isLuteFingering() const
|| _symId == SymId::luteFingeringRHThird;
}

//---------------------------------------------------------
// isOrnament
//---------------------------------------------------------

bool Articulation::isOrnament() const
{
return _symId == SymId::ornamentTurn
|| _symId == SymId::ornamentTurnInverted
|| _symId == SymId::ornamentTrill
|| _symId == SymId::brassMuteClosed
|| _symId == SymId::ornamentMordentInverted
|| _symId == SymId::ornamentMordent
|| _symId == SymId::ornamentTremblement
|| _symId == SymId::ornamentPrallMordent
|| _symId == SymId::ornamentLinePrall
|| _symId == SymId::ornamentUpPrall
|| _symId == SymId::ornamentUpMordent
|| _symId == SymId::ornamentPrecompMordentUpperPrefix
|| _symId == SymId::ornamentDownMordent
|| _symId == SymId::ornamentPrallUp
|| _symId == SymId::ornamentPrallDown
|| _symId == SymId::ornamentPrecompSlide;
}

//---------------------------------------------------------
// accessibleInfo
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions libmscore/articulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class Articulation final : public Element {
bool isAccent() const;
bool isMarcato() const;
bool isLuteFingering() const;
bool isOrnament() const;

void doAutoplace();
};
Expand Down
8 changes: 5 additions & 3 deletions libmscore/rendermidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2162,14 +2162,16 @@ void renderChordArticulation(Chord* chord, QList<NoteEventList> & ell, int & gat

static bool shouldRenderNote(Note* n)
{
int dist = 0;
while (n->tieBack()) {
n = n->tieBack()->startNote();
++dist;
if (n && n->playEvents().offtime() > (dist * NoteEvent::NOTE_LENGTH)) {
if (findFirstTrill(n->chord()))
// The previous tied note probably has events for this note too.
// That is, we don't need to render this note separately.
return false;
for (Articulation* a : n->chord()->articulations()) {
if (a->isOrnament()) {
return false;
}
}
}
return true;
Expand Down

0 comments on commit beb15fa

Please sign in to comment.