Merge pull request #1839 from jpirie/guitar-pro-import
Fix #48051: Fix to capo transposition in Guitar Pro files
This commit is contained in:
commit
70b40fdb53
11 changed files with 2343 additions and 2955 deletions
|
@ -48,6 +48,7 @@
|
|||
#include "libmscore/instrtemplate.h"
|
||||
#include "libmscore/fingering.h"
|
||||
#include "libmscore/notedot.h"
|
||||
#include "libmscore/stafftext.h"
|
||||
#include "preferences.h"
|
||||
|
||||
namespace Ms {
|
||||
|
@ -610,7 +611,6 @@ void GuitarPro4::read(QFile* fp)
|
|||
Instrument* instr = part->instr();
|
||||
instr->setStringData(stringData);
|
||||
part->setPartName(name);
|
||||
instr->setTranspose(Interval(capo));
|
||||
part->setLongName(name);
|
||||
|
||||
//
|
||||
|
@ -636,6 +636,15 @@ void GuitarPro4::read(QFile* fp)
|
|||
Segment* segment = measure->getSegment(Segment::Type::Clef, 0);
|
||||
segment->add(clef);
|
||||
|
||||
if (capo > 0) {
|
||||
Segment* s = measure->getSegment(Segment::Type::ChordRest, measure->tick());
|
||||
StaffText* st = new StaffText(score);
|
||||
st->setTextStyleType(TextStyleType::STAFF);
|
||||
st->setText(QString("Capo. fret ") + QString::number(capo));
|
||||
st->setParent(s);
|
||||
st->setTrack(i * VOICES);
|
||||
measure->add(st);
|
||||
}
|
||||
|
||||
Channel& ch = instr->channel(0);
|
||||
if (midiChannel == GP_DEFAULT_PERCUSSION_CHANNEL) {
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "libmscore/instrtemplate.h"
|
||||
#include "libmscore/fingering.h"
|
||||
#include "libmscore/notedot.h"
|
||||
#include "libmscore/stafftext.h"
|
||||
#include "preferences.h"
|
||||
|
||||
|
||||
|
@ -407,7 +408,6 @@ void GuitarPro5::readTracks()
|
|||
instr->setStringData(stringData);
|
||||
part->setPartName(name);
|
||||
part->setLongName(name);
|
||||
instr->setTranspose(Interval(capo));
|
||||
|
||||
//
|
||||
// determine clef
|
||||
|
@ -431,6 +431,17 @@ void GuitarPro5::readTracks()
|
|||
Segment* segment = measure->getSegment(Segment::Type::Clef, 0);
|
||||
segment->add(clef);
|
||||
|
||||
if (capo > 0) {
|
||||
Segment* s = measure->getSegment(Segment::Type::ChordRest, measure->tick());
|
||||
StaffText* st = new StaffText(score);
|
||||
st->setTextStyleType(TextStyleType::STAFF);
|
||||
st->setText(QString("Capo. fret ") + QString::number(capo));
|
||||
st->setParent(s);
|
||||
st->setTrack(i * VOICES);
|
||||
measure->add(st);
|
||||
}
|
||||
|
||||
|
||||
Channel& ch = instr->channel(0);
|
||||
if (midiChannel == GP_DEFAULT_PERCUSSION_CHANNEL) {
|
||||
ch.program = 0;
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "libmscore/hairpin.h"
|
||||
#include "libmscore/ottava.h"
|
||||
#include "libmscore/notedot.h"
|
||||
#include "libmscore/stafftext.h"
|
||||
#include "preferences.h"
|
||||
|
||||
namespace Ms {
|
||||
|
@ -1294,7 +1295,6 @@ void GuitarPro2::read(QFile* fp)
|
|||
Instrument* instr = part->instr();
|
||||
instr->setStringData(stringData);
|
||||
part->setPartName(name);
|
||||
instr->setTranspose(Interval(capo));
|
||||
part->setLongName(name);
|
||||
|
||||
//
|
||||
|
@ -1320,6 +1320,16 @@ void GuitarPro2::read(QFile* fp)
|
|||
Segment* segment = measure->getSegment(Segment::Type::Clef, 0);
|
||||
segment->add(clef);
|
||||
|
||||
if (capo > 0) {
|
||||
Segment* s = measure->getSegment(Segment::Type::ChordRest, measure->tick());
|
||||
StaffText* st = new StaffText(score);
|
||||
st->setTextStyleType(TextStyleType::STAFF);
|
||||
st->setText(QString("Capo. fret ") + QString::number(capo));
|
||||
st->setParent(s);
|
||||
st->setTrack(i * VOICES);
|
||||
measure->add(st);
|
||||
}
|
||||
|
||||
Channel& ch = instr->channel(0);
|
||||
if (midiChannel == int(StaffTypes::PERC_DEFAULT)) {
|
||||
ch.program = 0;
|
||||
|
@ -1901,7 +1911,6 @@ void GuitarPro3::read(QFile* fp)
|
|||
instr->setStringData(stringData);
|
||||
part->setPartName(name);
|
||||
part->setLongName(name);
|
||||
instr->setTranspose(Interval(capo));
|
||||
|
||||
//
|
||||
// determine clef
|
||||
|
@ -1926,6 +1935,16 @@ void GuitarPro3::read(QFile* fp)
|
|||
Segment* segment = measure->getSegment(Segment::Type::Clef, 0);
|
||||
segment->add(clef);
|
||||
|
||||
if (capo > 0) {
|
||||
Segment* s = measure->getSegment(Segment::Type::ChordRest, measure->tick());
|
||||
StaffText* st = new StaffText(score);
|
||||
st->setTextStyleType(TextStyleType::STAFF);
|
||||
st->setText(QString("Capo. fret ") + QString::number(capo));
|
||||
st->setParent(s);
|
||||
st->setTrack(i * VOICES);
|
||||
measure->add(st);
|
||||
}
|
||||
|
||||
Channel& ch = instr->channel(0);
|
||||
if (midiChannel == GP_DEFAULT_PERCUSSION_CHANNEL) {
|
||||
ch.program = 0;
|
||||
|
@ -2354,6 +2373,7 @@ Score::FileError importGTP(Score* score, const QString& name)
|
|||
StaffType st = *StaffType::preset(StaffTypes::TAB_DEFAULT);
|
||||
st.setSlashStyle(true);
|
||||
s1->setStaffType(&st);
|
||||
s1->setLines(staff->part()->instr()->stringData()->strings());
|
||||
cloneStaff(s,s1);
|
||||
p->staves()->front()->addBracket(BracketItem(BracketType::NORMAL, 2));
|
||||
}
|
||||
|
@ -2369,7 +2389,8 @@ Score::FileError importGTP(Score* score, const QString& name)
|
|||
if (staff->part()->instr()->stringData()->strings() > 0 && part->staves()->front()->staffType()->group() == StaffGroup::STANDARD) {
|
||||
Staff* staff2 = pscore->staff(1);
|
||||
staff2->setStaffType(StaffType::preset(StaffTypes::TAB_DEFAULT));
|
||||
}
|
||||
staff2->setLines(staff->part()->instr()->stringData()->strings());
|
||||
}
|
||||
|
||||
//
|
||||
// create excerpt title
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -952,7 +952,7 @@
|
|||
<linkedTo>1</linkedTo>
|
||||
<StaffType group="tablature">
|
||||
<name>tab6StrCommon</name>
|
||||
<lines>6</lines>
|
||||
<lines>7</lines>
|
||||
<lineDistance>1.5</lineDistance>
|
||||
<timesig>0</timesig>
|
||||
<durations>0</durations>
|
||||
|
@ -972,6 +972,7 @@
|
|||
<useNumbers>1</useNumbers>
|
||||
</StaffType>
|
||||
<bracket type="-1" span="0"/>
|
||||
<barLineSpan from="0" to="8">1</barLineSpan>
|
||||
</Staff>
|
||||
<trackName></trackName>
|
||||
<Instrument>
|
||||
|
@ -1848,8 +1849,8 @@
|
|||
</Measure>
|
||||
<Measure number="2">
|
||||
<Beam id="9">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>52</l1>
|
||||
<l2>52</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>9</lid>
|
||||
|
@ -2033,8 +2034,8 @@
|
|||
</Note>
|
||||
</Chord>
|
||||
<Beam id="10">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>52</l1>
|
||||
<l2>52</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>36</lid>
|
||||
|
@ -2225,8 +2226,8 @@
|
|||
</Note>
|
||||
</Chord>
|
||||
<Beam id="11">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>52</l1>
|
||||
<l2>52</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>65</lid>
|
||||
|
@ -2417,8 +2418,8 @@
|
|||
</Note>
|
||||
</Chord>
|
||||
<Beam id="12">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>52</l1>
|
||||
<l2>52</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>93</lid>
|
||||
|
|
|
@ -271,7 +271,7 @@
|
|||
<linkedTo>1</linkedTo>
|
||||
<StaffType group="tablature">
|
||||
<name>tab6StrCommon</name>
|
||||
<lines>6</lines>
|
||||
<lines>4</lines>
|
||||
<lineDistance>1.5</lineDistance>
|
||||
<timesig>0</timesig>
|
||||
<durations>0</durations>
|
||||
|
@ -291,6 +291,7 @@
|
|||
<useNumbers>1</useNumbers>
|
||||
</StaffType>
|
||||
<bracket type="-1" span="0"/>
|
||||
<barLineSpan from="0" to="14">1</barLineSpan>
|
||||
</Staff>
|
||||
<trackName></trackName>
|
||||
<Instrument>
|
||||
|
@ -483,8 +484,8 @@
|
|||
</Note>
|
||||
</Chord>
|
||||
<Beam id="5">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>34</l1>
|
||||
<l2>34</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>6</lid>
|
||||
|
@ -527,8 +528,8 @@
|
|||
</Note>
|
||||
</Chord>
|
||||
<Beam id="6">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>34</l1>
|
||||
<l2>34</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>12</lid>
|
||||
|
|
|
@ -325,7 +325,6 @@
|
|||
<linkedTo>1</linkedTo>
|
||||
<StaffType group="tablature">
|
||||
<name>tab6StrCommon</name>
|
||||
<lines>6</lines>
|
||||
<lineDistance>1.5</lineDistance>
|
||||
<timesig>0</timesig>
|
||||
<durations>0</durations>
|
||||
|
@ -345,6 +344,7 @@
|
|||
<useNumbers>1</useNumbers>
|
||||
</StaffType>
|
||||
<bracket type="-1" span="0"/>
|
||||
<barLineSpan from="0" to="12">1</barLineSpan>
|
||||
</Staff>
|
||||
<trackName></trackName>
|
||||
<Instrument>
|
||||
|
|
|
@ -387,7 +387,7 @@
|
|||
<linkedTo>1</linkedTo>
|
||||
<StaffType group="tablature">
|
||||
<name>tab6StrCommon</name>
|
||||
<lines>6</lines>
|
||||
<lines>4</lines>
|
||||
<lineDistance>1.5</lineDistance>
|
||||
<timesig>0</timesig>
|
||||
<durations>0</durations>
|
||||
|
@ -407,6 +407,7 @@
|
|||
<useNumbers>1</useNumbers>
|
||||
</StaffType>
|
||||
<bracket type="-1" span="0"/>
|
||||
<barLineSpan from="0" to="14">1</barLineSpan>
|
||||
</Staff>
|
||||
<trackName></trackName>
|
||||
<Instrument>
|
||||
|
@ -716,8 +717,8 @@
|
|||
<track>4</track>
|
||||
</Slur>
|
||||
<Beam id="7">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>34</l1>
|
||||
<l2>34</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>5</lid>
|
||||
|
@ -762,8 +763,8 @@
|
|||
<track>4</track>
|
||||
</Slur>
|
||||
<Beam id="8">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>34</l1>
|
||||
<l2>34</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>11</lid>
|
||||
|
@ -853,8 +854,8 @@
|
|||
<durationType>quarter</durationType>
|
||||
</Rest>
|
||||
<Beam id="9">
|
||||
<l1>46</l1>
|
||||
<l2>46</l2>
|
||||
<l1>34</l1>
|
||||
<l2>34</l2>
|
||||
</Beam>
|
||||
<Chord>
|
||||
<lid>24</lid>
|
||||
|
|
Loading…
Reference in a new issue