Check minimal length triplets for swing notes

This commit is contained in:
Matthias Neeracher 2009-03-14 23:06:55 +00:00
parent d8fd57b94a
commit 7086678c38

View File

@ -471,7 +471,7 @@ void VLMeasure::DecomposeNotes(const VLProperties & prop, VLNoteList & decompose
// Don't try to further shrink a minimal note // Don't try to further shrink a minimal note
// //
if (p.fDuration == kMinDuration) if (p.fDuration == kMinDuration)
goto haveDuration; goto checkTriplets;
// //
// Prefer further triplets // Prefer further triplets
// //
@ -522,6 +522,7 @@ void VLMeasure::DecomposeNotes(const VLProperties & prop, VLNoteList & decompose
else else
p.AlignToGrid(inBeat, kQuarterDur); // Align all others p.AlignToGrid(inBeat, kQuarterDur); // Align all others
} }
checkTriplets:
if (p.fVisual & VLNote::kTriplet) { if (p.fVisual & VLNote::kTriplet) {
// //
// Distinguish swing 8ths/16ths from triplets // Distinguish swing 8ths/16ths from triplets
@ -552,12 +553,13 @@ void VLMeasure::DecomposeNotes(const VLProperties & prop, VLNoteList & decompose
// Second swing note (8th triplet -> 8th) // Second swing note (8th triplet -> 8th)
// //
p.fVisual &= ~VLNote::kTriplet; p.fVisual &= ~VLNote::kTriplet;
} else if ((at % p.fDuration != 0) } else if ((p.fDuration > kMinDuration) &&
|| (p.fDuration != c.fDuration ((at % p.fDuration != 0)
&& 2*p.fDuration != c.fDuration) || (p.fDuration != c.fDuration
|| (n!=e && n->fDuration != c.fDuration && 2*p.fDuration != c.fDuration)
|| (n!=e && n->fDuration != c.fDuration
&& n->fDuration != 2*c.fDuration && n->fDuration != 2*c.fDuration
&& 2*n->fDuration != c.fDuration) && 2*n->fDuration != c.fDuration))
) { ) {
// //
// Get rid of awkward triplets // Get rid of awkward triplets