Skip to content

Commit c424380

Browse files
authored
Merge pull request #26246 from musescore/XTC-1191_gp5_ties
2 parents da9fc95 + ecb7741 commit c424380

File tree

4 files changed

+206
-4
lines changed

4 files changed

+206
-4
lines changed

src/importexport/guitarpro/internal/importgtp-gp5.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,17 +1529,19 @@ GuitarPro::ReadNoteResult GuitarPro5::readNote(int string, Note* note)
15291529
if (e && e->isChord()) {
15301530
Chord* chord2 = toChord(e);
15311531
for (Note* note2 : chord2->notes()) {
1532-
if (note2->string() == string && chords.empty()) {
1533-
Tie* tie = Factory::createTie(note2);
1532+
if (note2->string() == string) {
1533+
if (chords.empty()) {
1534+
Tie* tie = Factory::createTie(note2);
1535+
tie->setEndNote(note);
1536+
note2->add(tie);
1537+
}
15341538

15351539
// fixing gp5 bug with not storying let ring for tied notes
15361540
if (m_letRingForChords.find(chord2) != m_letRingForChords.end()) {
15371541
result.letRing = true;
15381542
muse::remove(m_letRingForChords, chord2);
15391543
}
15401544

1541-
tie->setEndNote(note);
1542-
note2->add(tie);
15431545
if (m_harmonicNotes.find(note) != m_harmonicNotes.end() && m_harmonicNotes.find(note2) != m_harmonicNotes.end()) {
15441546
Note* startHarmonicNote = m_harmonicNotes.at(note2);
15451547
Note* endHarmonicNote = m_harmonicNotes.at(note);
1.49 KB
Binary file not shown.
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<museScore version="4.50">
3+
<Score>
4+
<Division>480</Division>
5+
<showInvisible>1</showInvisible>
6+
<showUnprintable>1</showUnprintable>
7+
<showFrames>1</showFrames>
8+
<showMargins>0</showMargins>
9+
<metaTag name="arranger"></metaTag>
10+
<metaTag name="composer"></metaTag>
11+
<metaTag name="copyright"></metaTag>
12+
<metaTag name="lyricist"></metaTag>
13+
<metaTag name="movementNumber"></metaTag>
14+
<metaTag name="movementTitle"></metaTag>
15+
<metaTag name="source"></metaTag>
16+
<metaTag name="translator"></metaTag>
17+
<metaTag name="workNumber"></metaTag>
18+
<metaTag name="workTitle"></metaTag>
19+
<Part id="1">
20+
<Staff id="1">
21+
<StaffType group="pitched">
22+
<name>stdNormal</name>
23+
</StaffType>
24+
<defaultClef>G8vb</defaultClef>
25+
</Staff>
26+
<trackName>Add. Guitar 1</trackName>
27+
<Instrument id="electric-guitar">
28+
<longName>Add. Guitar 1</longName>
29+
<trackName></trackName>
30+
<instrumentId>pluck.guitar.electric</instrumentId>
31+
<singleNoteDynamics>0</singleNoteDynamics>
32+
<StringData>
33+
<frets>24</frets>
34+
<string>29</string>
35+
<string>34</string>
36+
<string>39</string>
37+
<string>44</string>
38+
<string>49</string>
39+
<string>54</string>
40+
<string>58</string>
41+
</StringData>
42+
<Channel>
43+
<program value="29"/>
44+
<controller ctrl="7" value="63"/>
45+
<controller ctrl="10" value="63"/>
46+
</Channel>
47+
</Instrument>
48+
</Part>
49+
<Staff id="1">
50+
<Measure>
51+
<voice>
52+
<KeySig>
53+
<concertKey>0</concertKey>
54+
</KeySig>
55+
<TimeSig>
56+
<sigN>4</sigN>
57+
<sigD>4</sigD>
58+
</TimeSig>
59+
<RehearsalMark>
60+
<text>Intro</text>
61+
</RehearsalMark>
62+
<Dynamic>
63+
<subtype>f</subtype>
64+
<velocity>96</velocity>
65+
</Dynamic>
66+
<Beam>
67+
<l1>-10</l1>
68+
<l2>-10</l2>
69+
</Beam>
70+
<Chord>
71+
<durationType>eighth</durationType>
72+
<Note>
73+
<Accidental>
74+
<subtype>accidentalSharp</subtype>
75+
</Accidental>
76+
<Spanner type="Tie">
77+
<Tie>
78+
</Tie>
79+
<next>
80+
<location>
81+
<fractions>1/8</fractions>
82+
</location>
83+
</next>
84+
</Spanner>
85+
<pitch>34</pitch>
86+
<tpc>24</tpc>
87+
<fret>0</fret>
88+
<string>5</string>
89+
</Note>
90+
</Chord>
91+
<Chord>
92+
<durationType>eighth</durationType>
93+
<Note>
94+
<Spanner type="Tie">
95+
<Tie>
96+
</Tie>
97+
<next>
98+
<location>
99+
<fractions>1/8</fractions>
100+
</location>
101+
</next>
102+
</Spanner>
103+
<Spanner type="Tie">
104+
<prev>
105+
<location>
106+
<fractions>-1/8</fractions>
107+
</location>
108+
</prev>
109+
</Spanner>
110+
<pitch>34</pitch>
111+
<tpc>24</tpc>
112+
<fret>0</fret>
113+
<string>5</string>
114+
</Note>
115+
<Note>
116+
<Accidental>
117+
<subtype>accidentalSharp</subtype>
118+
</Accidental>
119+
<Spanner type="Tie">
120+
<Tie>
121+
</Tie>
122+
<next>
123+
<location>
124+
<fractions>1/8</fractions>
125+
</location>
126+
</next>
127+
</Spanner>
128+
<pitch>61</pitch>
129+
<tpc>21</tpc>
130+
<fret>17</fret>
131+
<string>3</string>
132+
</Note>
133+
</Chord>
134+
<Chord>
135+
<durationType>eighth</durationType>
136+
<Note>
137+
<Spanner type="Tie">
138+
<prev>
139+
<location>
140+
<fractions>-1/8</fractions>
141+
</location>
142+
</prev>
143+
</Spanner>
144+
<pitch>34</pitch>
145+
<tpc>24</tpc>
146+
<fret>0</fret>
147+
<string>5</string>
148+
</Note>
149+
<Note>
150+
<Spanner type="Tie">
151+
<Tie>
152+
</Tie>
153+
<next>
154+
<location>
155+
<fractions>1/8</fractions>
156+
<notes>-1</notes>
157+
</location>
158+
</next>
159+
</Spanner>
160+
<Spanner type="Tie">
161+
<prev>
162+
<location>
163+
<fractions>-1/8</fractions>
164+
</location>
165+
</prev>
166+
</Spanner>
167+
<pitch>61</pitch>
168+
<tpc>21</tpc>
169+
<fret>17</fret>
170+
<string>3</string>
171+
</Note>
172+
</Chord>
173+
<Chord>
174+
<durationType>eighth</durationType>
175+
<Note>
176+
<Spanner type="Tie">
177+
<prev>
178+
<location>
179+
<fractions>-1/8</fractions>
180+
<notes>1</notes>
181+
</location>
182+
</prev>
183+
</Spanner>
184+
<pitch>61</pitch>
185+
<tpc>21</tpc>
186+
<fret>17</fret>
187+
<string>3</string>
188+
</Note>
189+
</Chord>
190+
<Rest>
191+
<durationType>half</durationType>
192+
</Rest>
193+
</voice>
194+
</Measure>
195+
</Staff>
196+
</Score>
197+
</museScore>

src/importexport/guitarpro/tests/guitarpro_tests.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,4 +756,7 @@ TEST_F(GuitarPro_Tests, gpHideRests) {
756756
TEST_F(GuitarPro_Tests, gpTupletEmptyMeasure) {
757757
gpReadTest("tuplet-empty-measure", "gp");
758758
}
759+
TEST_F(GuitarPro_Tests, gpSkippedTiedNotes) {
760+
gpReadTest("skipped_tied_notes", "gp5");
761+
}
759762
}

0 commit comments

Comments
 (0)