Skip to content

Commit

Permalink
fix #19871: no swing on tuplets
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Jan 15, 2016
1 parent da905b1 commit a469f2f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
2 changes: 1 addition & 1 deletion libmscore/rendermidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
//
Expand Down
8 changes: 6 additions & 2 deletions mtest/libmscore/midi/testSwing8thTriplets-ref.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
43 changes: 29 additions & 14 deletions mtest/libmscore/midi/testSwing8thTriplets.mscx
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="2.00">
<programVersion>2.0.0</programVersion>
<programRevision>3543170</programRevision>
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
<Synthesizer>
</Synthesizer>
<Division>480</Division>
<Style>
<figuredBassFontFamily>MScoreBC</figuredBassFontFamily>
<beamMinLen>1.32</beamMinLen>
<beamNoSlope>0</beamNoSlope>
<smallNoteMag>0.7</smallNoteMag>
<graceNoteMag>0.7</graceNoteMag>
<smallStaffMag>0.7</smallStaffMag>
<swingRatio>70</swingRatio>
<page-layout>
<page-height>1683.36</page-height>
Expand Down Expand Up @@ -68,8 +61,8 @@
</Staff>
<trackName>Flute</trackName>
<Instrument>
<longName pos="0">Flute</longName>
<shortName pos="0">Fl.</shortName>
<longName>Flute</longName>
<shortName>Fl.</shortName>
<trackName>Flute</trackName>
<minPitchP>59</minPitchP>
<maxPitchP>98</maxPitchP>
Expand Down Expand Up @@ -110,9 +103,6 @@
<concertClefType>G</concertClefType>
<transposingClefType>G</transposingClefType>
</Clef>
<KeySig>
<accidental>0</accidental>
</KeySig>
<TimeSig>
<sigN>4</sigN>
<sigD>4</sigD>
Expand All @@ -124,12 +114,19 @@
<text>system-text</text>
</StaffText>
<Chord>
<durationType>quarter</durationType>
<durationType>eighth</durationType>
<Note>
<pitch>72</pitch>
<tpc>14</tpc>
</Note>
</Chord>
<Chord>
<durationType>eighth</durationType>
<Note>
<pitch>76</pitch>
<tpc>18</tpc>
</Note>
</Chord>
<Tuplet id="1">
<normalNotes>2</normalNotes>
<actualNotes>3</actualNotes>
Expand Down Expand Up @@ -163,13 +160,31 @@
<tpc>16</tpc>
</Note>
</Chord>
<Tuplet id="2">
<normalNotes>2</normalNotes>
<actualNotes>2</actualNotes>
<baseNote>eighth</baseNote>
<Number>
<style>Tuplet</style>
<text>2</text>
</Number>
</Tuplet>
<Chord>
<durationType>quarter</durationType>
<Tuplet>2</Tuplet>
<durationType>eighth</durationType>
<Note>
<pitch>72</pitch>
<tpc>14</tpc>
</Note>
</Chord>
<Chord>
<Tuplet>2</Tuplet>
<durationType>eighth</durationType>
<Note>
<pitch>67</pitch>
<tpc>15</tpc>
</Note>
</Chord>
<Chord>
<durationType>quarter</durationType>
<Note>
Expand Down

0 comments on commit a469f2f

Please sign in to comment.