From a469f2f5848f4fe9d0b8daeece898f3c732fe758 Mon Sep 17 00:00:00 2001 From: Marc Sabatella Date: Thu, 14 Jan 2016 19:16:03 -0700 Subject: [PATCH] fix #19871: no swing on tuplets --- libmscore/rendermidi.cpp | 2 +- .../midi/testSwing8thTriplets-ref.txt | 8 +++- .../libmscore/midi/testSwing8thTriplets.mscx | 43 +++++++++++++------ 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/libmscore/rendermidi.cpp b/libmscore/rendermidi.cpp index be6775cf843c3..1071bd1764379 100644 --- a/libmscore/rendermidi.cpp +++ b/libmscore/rendermidi.cpp @@ -1470,7 +1470,7 @@ void Score::createPlayEvents(Chord* chord) int unit = st.swingUnit; int ratio = st.swingRatio; // Check if swing needs to be applied - if (unit) { + if (unit && !chord->tuplet()) { swingAdjustParams(chord, gateTime, ontime, unit, ratio); } // diff --git a/mtest/libmscore/midi/testSwing8thTriplets-ref.txt b/mtest/libmscore/midi/testSwing8thTriplets-ref.txt index 4695aa9d0d870..7ed373a7acf90 100644 --- a/mtest/libmscore/midi/testSwing8thTriplets-ref.txt +++ b/mtest/libmscore/midi/testSwing8thTriplets-ref.txt @@ -1,6 +1,8 @@ Tick = 0 Type = 144 Pitch = 72 Velocity = 80 Channel = 0 Tick = 0 Type = 3 Pitch = 0 Velocity = 0 Channel = 0 -Tick = 455 Type = 144 Pitch = 72 Velocity = 0 Channel = 0 +Tick = 323 Type = 144 Pitch = 72 Velocity = 0 Channel = 0 +Tick = 336 Type = 144 Pitch = 76 Velocity = 80 Channel = 0 +Tick = 471 Type = 144 Pitch = 76 Velocity = 0 Channel = 0 Tick = 480 Type = 144 Pitch = 77 Velocity = 80 Channel = 0 Tick = 480 Type = 4 Pitch = 0 Velocity = 0 Channel = 0 Tick = 631 Type = 144 Pitch = 77 Velocity = 0 Channel = 0 @@ -10,7 +12,9 @@ Tick = 800 Type = 144 Pitch = 74 Velocity = 80 Channel = Tick = 951 Type = 144 Pitch = 74 Velocity = 0 Channel = 0 Tick = 960 Type = 144 Pitch = 72 Velocity = 80 Channel = 0 Tick = 960 Type = 4 Pitch = 0 Velocity = 0 Channel = 0 -Tick = 1415 Type = 144 Pitch = 72 Velocity = 0 Channel = 0 +Tick = 1187 Type = 144 Pitch = 72 Velocity = 0 Channel = 0 +Tick = 1200 Type = 144 Pitch = 67 Velocity = 80 Channel = 0 +Tick = 1427 Type = 144 Pitch = 67 Velocity = 0 Channel = 0 Tick = 1440 Type = 144 Pitch = 62 Velocity = 80 Channel = 0 Tick = 1440 Type = 4 Pitch = 0 Velocity = 0 Channel = 0 Tick = 1895 Type = 144 Pitch = 62 Velocity = 0 Channel = 0 diff --git a/mtest/libmscore/midi/testSwing8thTriplets.mscx b/mtest/libmscore/midi/testSwing8thTriplets.mscx index 1c13490e0d0b1..c6a75316ec829 100644 --- a/mtest/libmscore/midi/testSwing8thTriplets.mscx +++ b/mtest/libmscore/midi/testSwing8thTriplets.mscx @@ -1,7 +1,6 @@ 2.0.0 - 3543170 0 @@ -9,12 +8,6 @@ 480 + 2 + + - quarter + 2 + eighth 72 14 + + 2 + eighth + + 67 + 15 + + quarter