Skip to content

Commit

Permalink
Merge pull request #4015 from handrok/GP6_Full_Measure
Browse files Browse the repository at this point in the history
fix #277016: Changing behavior of reading GTP file with incomplete measure
  • Loading branch information
anatoly-os committed Oct 29, 2018
2 parents 4eb9e28 + b3f2d1b commit 78fbab1
Show file tree
Hide file tree
Showing 4 changed files with 337 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mscore/importgtp-gp6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1945,11 +1945,9 @@ void GuitarPro6::readBars(QDomNode* barList, Measure* measure, ClefType oldClefI
// deal with possible anacrusis
if (ticks < measure->ticks() && voiceNum == 0) {
int mticks = measure->ticks();
measure->setLen(Fraction::fromTicks(ticks));
int offset = mticks - measure->ticks();
for (Measure* m = measure->nextMeasure(); m; m = m->nextMeasure()) {
m->setTick(m->tick() - offset);
}
int tickOffSet = mticks - ticks;
int track = staffIdx * VOICES + voiceNum;
score->setRest(ticks + measure->tick(), track, Fraction::fromTicks(tickOffSet), true, nullptr, true);
}
}
}
Expand Down
Binary file added mtest/guitarpro/UncompletedMeasure.gpx
Binary file not shown.
333 changes: 333 additions & 0 deletions mtest/guitarpro/UncompletedMeasure.gpx-ref.mscx
Original file line number Diff line number Diff line change
@@ -0,0 +1,333 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="3.01">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
<Division>480</Division>
<Style>
<ArpeggioHiddenInStdIfTab>1</ArpeggioHiddenInStdIfTab>
<Spatium>1.76389</Spatium>
</Style>
<showInvisible>1</showInvisible>
<showUnprintable>1</showUnprintable>
<showFrames>1</showFrames>
<showMargins>0</showMargins>
<metaTag name="arranger"></metaTag>
<metaTag name="composer"></metaTag>
<metaTag name="copyright"></metaTag>
<metaTag name="lyricist"></metaTag>
<metaTag name="movementNumber"></metaTag>
<metaTag name="movementTitle"></metaTag>
<metaTag name="poet"></metaTag>
<metaTag name="source"></metaTag>
<metaTag name="translator"></metaTag>
<metaTag name="workNumber"></metaTag>
<metaTag name="workTitle"></metaTag>
<Part>
<Staff id="1">
<StaffType group="pitched">
</StaffType>
</Staff>
<trackName>el.guit.</trackName>
<Instrument>
<longName>Electric Guitar</longName>
<shortName>El. Guit.</shortName>
<trackName>Electric Guitar (Treble Clef)</trackName>
<minPitchP>40</minPitchP>
<maxPitchP>88</maxPitchP>
<minPitchA>40</minPitchA>
<maxPitchA>86</maxPitchA>
<transposeDiatonic>-7</transposeDiatonic>
<transposeChromatic>-12</transposeChromatic>
<instrumentId>pluck.guitar.electric</instrumentId>
<clef>G8vb</clef>
<StringData>
<frets>24</frets>
<string>52</string>
<string>57</string>
<string>62</string>
<string>67</string>
<string>71</string>
<string>76</string>
</StringData>
<Articulation>
<velocity>100</velocity>
<gateTime>100</gateTime>
</Articulation>
<Articulation name="staccatissimo">
<velocity>100</velocity>
<gateTime>33</gateTime>
</Articulation>
<Articulation name="staccato">
<velocity>100</velocity>
<gateTime>50</gateTime>
</Articulation>
<Articulation name="portato">
<velocity>100</velocity>
<gateTime>67</gateTime>
</Articulation>
<Articulation name="tenuto">
<velocity>100</velocity>
<gateTime>100</gateTime>
</Articulation>
<Articulation name="marcato">
<velocity>120</velocity>
<gateTime>67</gateTime>
</Articulation>
<Articulation name="sforzato">
<velocity>120</velocity>
<gateTime>100</gateTime>
</Articulation>
<Channel>
<program value="27"/>
</Channel>
</Instrument>
</Part>
<Staff id="1">
<VBox>
<height>10</height>
<linkedMain/>
</VBox>
<Measure>
<voice>
<Clef>
<concertClefType>G</concertClefType>
<transposingClefType>G</transposingClefType>
<linkedMain/>
</Clef>
<KeySig>
<linkedMain/>
<accidental>0</accidental>
</KeySig>
<TimeSig>
<linkedMain/>
<sigN>4</sigN>
<sigD>4</sigD>
</TimeSig>
<Dynamic>
<subtype>mf</subtype>
<velocity>80</velocity>
<linkedMain/>
</Dynamic>
<Tempo>
<tempo>2</tempo>
<linkedMain/>
<text><sym>metNoteQuarterUp</sym> = 120</text>
</Tempo>
<Chord>
<linkedMain/>
<durationType>quarter</durationType>
<Note>
<linkedMain/>
<pitch>65</pitch>
<tpc>13</tpc>
<fret>1</fret>
<string>0</string>
</Note>
</Chord>
<Rest>
<linkedMain/>
<dots>1</dots>
<durationType>half</durationType>
</Rest>
</voice>
</Measure>
</Staff>
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
<Division>480</Division>
<Style>
<ArpeggioHiddenInStdIfTab>1</ArpeggioHiddenInStdIfTab>
<Spatium>1.76389</Spatium>
</Style>
<showInvisible>1</showInvisible>
<showUnprintable>1</showUnprintable>
<showFrames>1</showFrames>
<showMargins>0</showMargins>
<Part>
<Staff id="1">
<linkedTo>1</linkedTo>
<StaffType group="pitched">
</StaffType>
<bracket type="0" span="2" col="0"/>
</Staff>
<Staff id="2">
<linkedTo>1</linkedTo>
<StaffType group="tablature">
<name>tab6StrCommon</name>
<lines>6</lines>
<lineDistance>1.5</lineDistance>
<timesig>0</timesig>
<durations>0</durations>
<durationFontName>MuseScore Tab Modern</durationFontName>
<durationFontSize>15</durationFontSize>
<durationFontY>0</durationFontY>
<fretFontName>MuseScore Tab Serif</fretFontName>
<fretFontSize>9</fretFontSize>
<fretFontY>0</fretFontY>
<linesThrough>0</linesThrough>
<minimStyle>1</minimStyle>
<onLines>1</onLines>
<showRests>0</showRests>
<stemsDown>1</stemsDown>
<stemsThrough>0</stemsThrough>
<upsideDown>0</upsideDown>
<useNumbers>1</useNumbers>
</StaffType>
</Staff>
<trackName></trackName>
<Instrument>
<longName>Electric Guitar</longName>
<shortName>El. Guit.</shortName>
<trackName>Electric Guitar (Treble Clef)</trackName>
<minPitchP>40</minPitchP>
<maxPitchP>88</maxPitchP>
<minPitchA>40</minPitchA>
<maxPitchA>86</maxPitchA>
<transposeDiatonic>-7</transposeDiatonic>
<transposeChromatic>-12</transposeChromatic>
<instrumentId>pluck.guitar.electric</instrumentId>
<clef>G8vb</clef>
<StringData>
<frets>24</frets>
<string>52</string>
<string>57</string>
<string>62</string>
<string>67</string>
<string>71</string>
<string>76</string>
</StringData>
<Articulation>
<velocity>100</velocity>
<gateTime>100</gateTime>
</Articulation>
<Articulation name="staccatissimo">
<velocity>100</velocity>
<gateTime>33</gateTime>
</Articulation>
<Articulation name="staccato">
<velocity>100</velocity>
<gateTime>50</gateTime>
</Articulation>
<Articulation name="portato">
<velocity>100</velocity>
<gateTime>67</gateTime>
</Articulation>
<Articulation name="tenuto">
<velocity>100</velocity>
<gateTime>100</gateTime>
</Articulation>
<Articulation name="marcato">
<velocity>120</velocity>
<gateTime>67</gateTime>
</Articulation>
<Articulation name="sforzato">
<velocity>120</velocity>
<gateTime>100</gateTime>
</Articulation>
<Channel>
<program value="27"/>
</Channel>
</Instrument>
</Part>
<Staff id="1">
<VBox>
<height>10</height>
<linked>
</linked>
<Text>
<style>Instrument Name (Part)</style>
<text>Electric Guitar</text>
</Text>
</VBox>
<Measure>
<voice>
<Clef>
<concertClefType>G</concertClefType>
<transposingClefType>G</transposingClefType>
<linked>
</linked>
</Clef>
<KeySig>
<linked>
</linked>
<accidental>0</accidental>
</KeySig>
<TimeSig>
<linked>
</linked>
<sigN>4</sigN>
<sigD>4</sigD>
</TimeSig>
<Dynamic>
<subtype>mf</subtype>
<velocity>80</velocity>
<linked>
</linked>
</Dynamic>
<Tempo>
<tempo>2</tempo>
<linked>
</linked>
<text><sym>metNoteQuarterUp</sym> = 120</text>
</Tempo>
<Chord>
<linked>
</linked>
<durationType>quarter</durationType>
<Note>
<linked>
</linked>
<pitch>65</pitch>
<tpc>13</tpc>
<fret>1</fret>
<string>0</string>
</Note>
</Chord>
<Rest>
<linked>
</linked>
<dots>1</dots>
<durationType>half</durationType>
</Rest>
</voice>
</Measure>
</Staff>
<Staff id="2">
<Measure>
<voice>
<KeySig>
<linked>
<indexDiff>2</indexDiff>
</linked>
<accidental>0</accidental>
</KeySig>
<Chord>
<linked>
<indexDiff>5</indexDiff>
</linked>
<durationType>quarter</durationType>
<Note>
<linked>
<indexDiff>5</indexDiff>
</linked>
<pitch>65</pitch>
<tpc>13</tpc>
<fret>1</fret>
<string>0</string>
</Note>
</Chord>
<Rest>
<linked>
</linked>
<dots>1</dots>
<durationType>half</durationType>
</Rest>
</voice>
</Measure>
</Staff>
<name>el.guit.</name>
</Score>
</Score>
</museScore>
1 change: 1 addition & 0 deletions mtest/guitarpro/tst_guitarpro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ private slots:
void gp3CapoFret() { gpReadTest("capo-fret", "gp3"); }
void gp4CapoFret() { gpReadTest("capo-fret", "gp4"); }
void gp5CapoFret() { gpReadTest("capo-fret", "gp5"); }
void gp6UncompletedMeasure() { gpReadTest("UncompletedMeasure", "gpx"); }
};

//---------------------------------------------------------
Expand Down

0 comments on commit 78fbab1

Please sign in to comment.