Skip to content

Commit

Permalink
fix #105666: add support for Croatian instruments (Tambura)
Browse files Browse the repository at this point in the history
As instrumentsxml.h is never touched by a C/C++ compiler, 8-bit ASCII and UTF-8 characters should never cause any kind of comapitibilty or standards compliance problems, and actually never had so far with at
least the ♭ being used in multiple places, so we can as well have ü, č and Č there too.
So fix Güiro in other places too, in C++ code in a C++11 compatible manner.

While at it fix some duplicate short instrument names and also a fix/workaround for an lupdate diagnostic
  • Loading branch information
Jojo-Schmitz authored and lasconic committed Apr 15, 2016
1 parent 8bd75a1 commit ca3d3f8
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 14 deletions.
4 changes: 2 additions & 2 deletions mscore/importgtp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ void GuitarPro::initGuitarProDrumset()
gpDrumset->drum(70) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Maracas"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(71) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Short Whistle"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(72) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Long Whistle"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(73) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Short Guiro"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(74) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Long Guiro"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(73) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Short Güiro"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(74) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Long Güiro"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(75) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Claves"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(76) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Hi Wood Block"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
gpDrumset->drum(77) = DrumInstrument(QT_TRANSLATE_NOOP("drumset", "Low Wood Block"), NoteHead::Group::HEAD_NORMAL, 3, MScore::Direction::UP);
Expand Down
2 changes: 1 addition & 1 deletion mscore/webpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class MyWebPage: public QWebPage

class MyWebView: public QWebView
{
//Q_OBJECT
Q_OBJECT

MyWebPage m_page;
QProgressBar* progressBar;
Expand Down
8 changes: 4 additions & 4 deletions mtest/guitarpro/all-percussion.gp5-ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,14 @@
<head>0</head>
<line>3</line>
<voice>0</voice>
<name>Short Guiro</name>
<name>Short Güiro</name>
<stem>1</stem>
</Drum>
<Drum pitch="74">
<head>0</head>
<line>3</line>
<voice>0</voice>
<name>Long Guiro</name>
<name>Long Güiro</name>
<stem>1</stem>
</Drum>
<Drum pitch="75">
Expand Down Expand Up @@ -1678,14 +1678,14 @@
<head>0</head>
<line>3</line>
<voice>0</voice>
<name>Short Guiro</name>
<name>Short Güiro</name>
<stem>1</stem>
</Drum>
<Drum pitch="74">
<head>0</head>
<line>3</line>
<voice>0</voice>
<name>Long Guiro</name>
<name>Long Güiro</name>
<stem>1</stem>
</Drum>
<Drum pitch="75">
Expand Down
5 changes: 3 additions & 2 deletions share/instruments/generateTs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

def addMessage(f, text, comment=''):
if (comment):
f.write("//: " + comment.encode('utf8') + "\n")
f.write('QT_TRANSLATE_NOOP("InstrumentsXML", "' + text.encode('utf8') + '"),\n')
f.write('QT_TRANSLATE_NOOP3("InstrumentsXML", u8"' + text.encode('utf8') + '", u8"' + comment.encode('utf8') + '"),\n')
else:
f.write('QT_TRANSLATE_NOOP("InstrumentsXML", u8"' + text.encode('utf8') + '"),\n')



Expand Down
113 changes: 113 additions & 0 deletions share/instruments/instruments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9318,6 +9318,119 @@
<!-- <clef>TAB</clef> -->
<genre>common</genre>
</Instrument>
<Instrument id="prima">
<longName>Prima</longName>
<shortName>Pr.</shortName>
<description>Prima</description>
<musicXMLid>pluck.tambura.prima</musicXMLid>
<StringData>
<frets>15</frets>
<string>52</string>
<string>57</string>
<string>62</string>
<string>67</string>
</StringData>
<clef>G</clef>
<barlineSpan>1</barlineSpan>
<aPitchRange>64-91</aPitchRange>
<pPitchRange>64-91</pPitchRange>
<transposeDiatonic>7</transposeDiatonic>
<transposeChromatic>12</transposeChromatic>
<Channel>
<program value="24"/>
</Channel>
<genre>ethnic</genre>
</Instrument>
<Instrument id="brac">
<longName>Brač</longName>
<shortName>Br.</shortName>
<description>Brač</description>
<musicXMLid>pluck.tambura.brac</musicXMLid>
<StringData>
<frets>15</frets>
<string>40</string>
<string>45</string>
<string>50</string>
<string>55</string>
</StringData>
<clef>G</clef>
<barlineSpan>1</barlineSpan>
<aPitchRange>52-79</aPitchRange>
<pPitchRange>52-79</pPitchRange>
<Channel>
<program value="24"/>
</Channel>
<genre>ethnic</genre>
</Instrument>
<Instrument id="celo">
<longName>Čelo</longName>
<shortName>Č.</shortName>
<description>Čelo</description>
<musicXMLid>pluck.tambura.celo</musicXMLid>
<StringData>
<frets>15</frets>
<string>40</string>
<string>45</string>
<string>50</string>
<string>55</string>
</StringData>
<clef>G</clef>
<barlineSpan>1</barlineSpan>
<aPitchRange>3-60</aPitchRange>
<pPitchRange>3-60</pPitchRange>
<transposeDiatonic>-14</transposeDiatonic>
<transposeChromatic>-24</transposeChromatic>
<Channel>
<program value="24"/>
</Channel>
<genre>ethnic</genre>
</Instrument>
<Instrument id="bugarija">
<longName>Bugarija</longName>
<shortName>Bu.</shortName>
<description>Bugarija</description>
<musicXMLid>pluck.tambura.bugarija</musicXMLid>
<StringData>
<frets>15</frets>
<string>38</string>
<string>42</string>
<string>45</string>
<string>50</string>
</StringData>
<clef>G</clef>
<barlineSpan>1</barlineSpan>
<aPitchRange>43-66</aPitchRange>
<pPitchRange>43-66</pPitchRange>
<transposeDiatonic>-7</transposeDiatonic>
<transposeChromatic>-12</transposeChromatic>
<Channel>
<program value="24"/>
</Channel>
<genre>ethnic</genre>
</Instrument>
<Instrument id="berda">
<longName>Berda</longName>
<shortName>Be.</shortName>
<description>Berda</description>
<musicXMLid>pluck.tambura.berda</musicXMLid>
<StringData>
<frets>15</frets>
<string>28</string>
<string>33</string>
<string>38</string>
<string>43</string>
</StringData>
<clef>F</clef>
<barlineSpan>1</barlineSpan>
<aPitchRange>28-66</aPitchRange>
<pPitchRange>28-66</pPitchRange>
<transposeDiatonic>-7</transposeDiatonic>
<transposeChromatic>-12</transposeChromatic>
<Channel>
<program value="32"/>
</Channel>
<genre>ethnic</genre>
</Instrument>
</InstrumentGroup>
<InstrumentGroup id="strings">
<name>Strings</name>
Expand Down
25 changes: 20 additions & 5 deletions share/instruments/instrumentsxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "B She."),
QT_TRANSLATE_NOOP("InstrumentsXML", "Brass"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Brass"),
//: Brass
QT_TRANSLATE_NOOP("InstrumentsXML", "Br."),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Br.", "Brass"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Horn in F"),
//: Horn in F
QT_TRANSLATE_NOOP("InstrumentsXML", "F Hn."),
Expand Down Expand Up @@ -717,7 +717,7 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "Rag Dung"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Rg. Dng."),
QT_TRANSLATE_NOOP("InstrumentsXML", "Bugle"),
//: Bugle
QT_TRANSLATE_NOOP("InstrumentsXML", "Bu."),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Bu.", "Bugle"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Soprano Bugle"),
//: Soprano Bugle
QT_TRANSLATE_NOOP("InstrumentsXML", "Sop. Bu."),
Expand Down Expand Up @@ -1056,7 +1056,7 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "Tam-tam"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tam-tam"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Bells"),
//: Bells
QT_TRANSLATE_NOOP("InstrumentsXML", "Be."),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Be.", "Bells"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Sleigh Bells"),
//: Sleigh Bells
QT_TRANSLATE_NOOP("InstrumentsXML", "Sle. Be."),
Expand Down Expand Up @@ -1117,8 +1117,8 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "Clv."),
QT_TRANSLATE_NOOP("InstrumentsXML", "Castanets"),
//: Castanets
QT_TRANSLATE_NOOP("InstrumentsXML", "Cst."),
QT_TRANSLATE_NOOP("InstrumentsXML", "Guiro"),
//: Guiro
QT_TRANSLATE_NOOP("InstrumentsXML", "Güiro"),
//: Güiro
QT_TRANSLATE_NOOP("InstrumentsXML", "Gro."),
QT_TRANSLATE_NOOP("InstrumentsXML", "Maracas"),
//: Maracas
Expand Down Expand Up @@ -1563,6 +1563,21 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "5-str. Electric Bass"),
//: 5-str. Electric Bass
QT_TRANSLATE_NOOP("InstrumentsXML", "El. B."),
QT_TRANSLATE_NOOP("InstrumentsXML", "5-str. Electric Bass [Tablature]"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Prima"),
//: Prima
QT_TRANSLATE_NOOP("InstrumentsXML", "Pr."),
QT_TRANSLATE_NOOP("InstrumentsXML", "Brač"),
//: Brač
QT_TRANSLATE_NOOP3("InstrumentsXML", "Br.", "Brač"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Čelo"),
//: Čelo
QT_TRANSLATE_NOOP("InstrumentsXML", "Č."),
QT_TRANSLATE_NOOP("InstrumentsXML", "Bugarija"),
//: Bugarija
QT_TRANSLATE_NOOP3("InstrumentsXML", "Bu.", "Bugarija"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Berda"),
//: Berda
QT_TRANSLATE_NOOP3("InstrumentsXML", "Be.", "Berda"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Strings"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Erhu"),
//: Erhu
Expand Down

0 comments on commit ca3d3f8

Please sign in to comment.