updated instruments from 3.x

This commit is contained in:
Igor Korsukov 2021-01-28 15:00:41 +02:00
parent f92d17b8e6
commit b122c9857a
6 changed files with 1323 additions and 111 deletions

View file

@ -19,6 +19,7 @@
install(FILES
instruments.xml
orders.xml
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}instruments
)

View file

@ -0,0 +1,54 @@
#!/usr/bin/env python3
# If you get Unicode errors on Windows, try setting the environment variable
# PYTHONIOENCODING=utf-8. More info at https://stackoverflow.com/a/12834315
import xml.etree.ElementTree as ET
import os
# Create instruments.csv (must specify encoding and line ending on Windows)
f = open('instruments.csv', 'w', newline='\n', encoding='utf-8')
#instruments.xml
tree = ET.parse('instruments.xml')
root = tree.getroot()
previousLongName = ''
genres = []
genreIds = []
header = ['longName', 'InstrumentId', 'trackName', 'instrGroup', 'family']
for child in root:
if child.tag == 'Genre':
g = child.find("name")
genres.append(g.text)
genreIds.append(child.attrib['id'])
elif child.tag == 'InstrumentGroup':
if header:
f.write('\t'.join(header + genres) + '\n')
header = None
instrGroup = child.attrib['id']
genreMembers = [' ']*len(genres)
for instrument in child.findall('Instrument'):
instrumentId = instrument.attrib['id']
element = instrument.find('longName')
if element is None:
longName = ' '
else:
longName = element.text
element = instrument.find('trackName')
if element is None:
trackName = ' '
else:
trackName = element.text
element = instrument.find('family')
if element is None:
family = ' '
else:
family = element.text
for genre in instrument.findall('genre'):
genreMembers[genreIds.index(genre.text)] = 'x'
f.write(f'{longName}\t{instrumentId}\t{trackName}\t{instrGroup}\t{family}\t' + '\t'.join(genreMembers) + '\n')
f.close()

View file

@ -40,6 +40,10 @@ for child in root:
genre = child.find("name")
print("Genre " + genre.text)
addMessage(f, genre.text)
if child.tag == "Family":
family = child.find("name")
print("Family " + family.text)
addMessage(f, family.text)
elif child.tag == "InstrumentGroup":
instrGroup = child.find("name")
print("Instr Group : " + instrGroup.text)
@ -84,4 +88,14 @@ for child in root:
print(" Instrument, MidiAction name :" + imaName)
addMessage(f, ima)
#orders.xml
tree = ET.parse('orders.xml')
root = tree.getroot()
for child in root:
if child.tag == "Order":
order = child.find("name")
print("Order " + order.text)
addMessage(f, order.text, '', "OrderXML")
f.close()

File diff suppressed because it is too large Load diff

View file

@ -59,6 +59,40 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "Electronic Music"),
QT_TRANSLATE_NOOP("InstrumentsXML", "World Music"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Early Music"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Classroom"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Flutes"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Oboes"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Clarinets"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Bassoons"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Saxophones"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Recorders"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Horns"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Cornets"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Flugelhorns"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Alto Horns"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Baritone Horns"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Euphoniums"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Trumpets"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Trombones"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tubas"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Timpani"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Keyboard Percussion"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Harps"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Orff Percussion"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Pitched Percussion"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Unpitched Metal Percussion"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Unpitched Wooden Percussion"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Drums"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Batterie"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Other Percussion"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Voices"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Keyboards"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Organs"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Synths"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Plucked Strings"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Guitars"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Bass Guitars"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Orchestral Strings"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Viols"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Woodwinds"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Winds"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Wi.", "Winds"),
@ -1024,18 +1058,33 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "Boy Soprano"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "B. S.", "Boy Soprano"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Soprano"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "S.", "Soprano"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Soprano"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "S.", "Soprano"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Soprano (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Mezzo-soprano"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Mzs.", "Mezzo-soprano"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Mezzo-soprano"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Mzs.", "Mezzo-soprano"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Mezzo-soprano (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Alto"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "A.", "Alto"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Alto"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "A.", "Alto"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Alto (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Contralto"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Contr.", "Contralto"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Countertenor"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Ct.", "Countertenor"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tenor"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "T.", "Tenor"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tenor"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "T.", "Tenor"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tenor (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Baritone"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Bar.", "Baritone"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Baritone"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Bar.", "Baritone"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Baritone (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Bass"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "B.", "Bass"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Women"),
@ -1046,21 +1095,6 @@ QT_TRANSLATE_NOOP("InstrumentsXML", "Men"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "M.", "Men"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tenor"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Bass"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Soprano"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "S.", "Soprano"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Soprano (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Mezzo-soprano"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Mzs.", "Mezzo-soprano"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Mezzo-soprano (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Alto"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "A.", "Alto"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Alto (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tenor"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "T.", "Tenor"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Tenor (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Baritone"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Bar.", "Baritone"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Baritone (C Clef)"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Kazoo"),
QT_TRANSLATE_NOOP3("InstrumentsXML", "Kaz.", "Kazoo"),
QT_TRANSLATE_NOOP("InstrumentsXML", "Keyboards"),
@ -1511,3 +1545,14 @@ QT_TRANSLATE_NOOP3("InstrumentsXML", "D Vne.", "D Violone"),
QT_TRANSLATE_NOOP("InstrumentsXML", "arco"),
QT_TRANSLATE_NOOP("InstrumentsXML", "pizzicato"),
QT_TRANSLATE_NOOP("InstrumentsXML", "tremolo"),
QT_TRANSLATE_NOOP("OrderXML", "Orchestral"),
QT_TRANSLATE_NOOP("OrderXML", "Choir"),
QT_TRANSLATE_NOOP("OrderXML", "Marching Band"),
QT_TRANSLATE_NOOP("OrderXML", "Big Band"),
QT_TRANSLATE_NOOP("OrderXML", "Jazz Combo"),
QT_TRANSLATE_NOOP("OrderXML", "Rock Band"),
QT_TRANSLATE_NOOP("OrderXML", "Concert Band"),
QT_TRANSLATE_NOOP("OrderXML", "Brass Band"),
QT_TRANSLATE_NOOP("OrderXML", "Woodwind Ensemble"),
QT_TRANSLATE_NOOP("OrderXML", "Brass Ensemble"),
QT_TRANSLATE_NOOP("OrderXML", "String Ensemble"),

View file

@ -0,0 +1,296 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore>
<Order id="orchestral">
<name>Orchestral</name>
<section id="woodwind" showSystemMarkings="true">
<family>flutes</family>
<family>oboes</family>
<family>clarinets</family>
<family>saxophones</family>
<family>bassoons</family>
<unsorted group="woodwinds"/>
</section>
<section id="brass">
<family>horns</family>
<family>trumpets</family>
<family>cornets</family>
<family>flugelhorns</family>
<family>trombones</family>
<family>tubas</family>
</section>
<section id="timpani">
<family>timpani</family>
</section>
<section id="percussion">
<family>keyboard-percussion</family>
<family>drums</family>
<family>unpitched-metal-percussion</family>
<family>unpitched-wooden-percussion</family>
<family>other-percussion</family>
</section>
<family>keyboards</family>
<family>harps</family>
<family>organs</family>
<family>synths</family>
<section id="plucked-strings">
<family>plucked-strings</family>
</section>
<soloists/>
<section id="voices" barLineSpan="false">
<family>voices</family>
</section>
<section id="strings" showSystemMarkings="true">
<family>orchestral-strings</family>
</section>
<unsorted/>
</Order>
<Order id="choir">
<name>Choir</name>
<soloists/>
<section id="voices" barLineSpan="false">
<family>voices</family>
</section>
<family>keyboards</family>
<family>organs</family>
<unsorted/>
</Order>
<Order id="marching-band">
<name>Marching Band</name>
<instrument id="mellophone">
<family id="horns">Horns</family>
</instrument>
<instrument id="sousaphone">
<family id="tubas">Tubas</family>
</instrument>
<instrument id="drumset">
<family id="drumset">Drumset</family>
</instrument>
<soloists/>
<section id="woodwind">
<family>flutes</family>
<family>oboes</family>
<family>bassoons</family>
<family>clarinets</family>
</section>
<section id="saxophones">
<family>saxophones</family>
</section>
<unsorted group="woodwinds"/>
<section id="brass">
<family>cornets</family>
<family>trumpets</family>
<family>flugelhorns</family>
<family>horns</family>
<family>trombones</family>
<family>baritone-horns</family>
<family>tubas</family>
</section>
<unsorted group="brass"/>
<section id="front-ensemble" barLineSpan="false">
<family>keyboard-percussion</family>
</section>
<family>timpani</family>
<family>synths</family>
<section id="rhythm-section">
<family>guitars</family>
<family>bass-guitars</family>
<family>drumset</family>
</section>
<!-- auxiliary -->
<section id="percussion">
<family>unpitched-percussion</family>
<family>other-percussion</family>
</section>
<unsorted/>
<section id="batterie" barLineSpan="false">
<family>batterie</family>
</section>
</Order>
<Order id="bigband">
<name>Big Band</name>
<instrument id="contrabass">
<family id="contrabasses">Basses</family>
</instrument>
<instrument id="double-bass">
<family id="contrabasses">Basses</family>
</instrument>
<soloists/>
<section id="woodwind" thinBrackets="false">
<family>flutes</family>
<family>clarinets</family>
<family>saxophones</family>
</section>
<section id="trumpets" thinBrackets="false">
<family>trumpets</family>
<family>flugelhorns</family>
</section>
<section id="trombones" thinBrackets="false">
<family>trombones</family>
</section>
<section id="vocals" barLineSpan="false" thinBrackets="false">
<family>voices</family>
</section>
<unsorted/>
<section id="guitars" thinBrackets="false">
<family>guitars</family>
</section>
<family>keyboards</family>
<section id="basses">
<family>bass-guitars</family>
<family>contrabasses</family>
</section>
<family>drums</family>
<section id="pitched-percussion" thinBrackets="false">
<unsorted group="pitched-percussion"/>
</section>
<section id="percussion" thinBrackets="false">
<unsorted group="unpitched-percussion"/>
</section>
</Order>
<Order id="jazz-combo">
<name>Jazz Combo</name>
<instrument id="contrabass">
<family id="contrabasses">Basses</family>
</instrument>
<instrument id="double-bass">
<family id="contrabasses">Basses</family>
</instrument>
<soloists/>
<family>voices</family>
<family>flutes</family>
<family>clarinets</family>
<family>flugelhorns</family>
<family>trumpets</family>
<family>saxophones</family>
<family>trombones</family>
<unsorted/>
<family>guitars</family>
<family>keyboards</family>
<family>bass-guitars</family>
<family>contrabasses</family>
<family>drums</family>
<unsorted group="pitched-percussion"/>
<unsorted group="unpitched-percussion"/>
</Order>
<Order id="rock-band">
<name>Rock Band</name>
<section id="vocals" barLineSpan="false" thinBrackets="false">
<family>voices</family>
</section>
<section id="guitars" thinBrackets="false">
<family>plucked-strings</family>
</section>
<family>drums</family>
<unsorted/>
</Order>
<Order id="concert-band">
<name>Concert Band</name>
<instrument id="contrabass">
<family id="contrabasses">Basses</family>
</instrument>
<instrument id="double-bass">
<family id="contrabasses">Basses</family>
</instrument>
<soloists/>
<section id="woodwind">
<family>flutes</family>
<family>oboes</family>
<family>bassoons</family>
</section>
<section id="clarinets">
<family>clarinets</family>
</section>
<section id="saxophones">
<family>saxophones</family>
</section>
<unsorted group="woodwinds"/>
<section id="brass">
<family>cornets</family>
<family>trumpets</family>
<family>flugelhorns</family>
<family>horns</family>
<family>trombones</family>
<family>baritone-horns</family>
<family>euphoniums</family>
<family>tubas</family>
</section>
<unsorted group="brass"/>
<family>guitars</family>
<family>bass-guitars</family>
<family>contrabasses</family>
<section id="percussion" thinBrackets="false">
<family>timpani</family>
<family>keyboard-percussion</family>
<family>drums</family>
<unsorted group="unpitched-percussion"/>
</section>
<unsorted/>
</Order>
<Order id="brass-band">
<name>Brass Band</name>
<soloists/>
<section id="cornets" thinBrackets="false">
<family>cornets</family>
</section>
<section id="horns" thinBrackets="false">
<family>flugelhorns</family>
<family>horns</family>
</section>
<section id="baritones" thinBrackets="false">
<family>baritone-horns</family>
</section>
<section id="trombones" thinBrackets="false">
<family>trombones</family>
</section>
<section id="euphoniums" thinBrackets="false">
<family>euphoniums</family>
</section>
<section id="tubas" thinBrackets="false">
<family>tubas</family>
</section>
<section id="percussion" thinBrackets="false">
<family>timpani</family>
<family>keyboard-percussion</family>
<family>drums</family>
<unsorted group="unpitched-percussion"/>
</section>
<unsorted/>
</Order>
<Order id="woodwind-ensemble">
<name>Woodwind Ensemble</name>
<soloists/>
<section id="woodwind" thinBrackets="false">
<family>flutes</family>
<family>oboes</family>
<family>clarinets</family>
<family>horns</family>
<family>saxophones</family>
<family>bassoons</family>
</section>
<family>keyboards</family>
<unsorted/>
</Order>
<Order id="brass-ensemble">
<name>Brass Ensemble</name>
<soloists/>
<section id="brass" thinBrackets="false">
<family>trumpets</family>
<family>cornets</family>
<family>flugelhorns</family>
<family>horns</family>
<family>trombones</family>
<family>tubas</family>
</section>
<family>keyboards</family>
<unsorted/>
</Order>
<Order id="string-ensemble">
<name>String Ensemble</name>
<soloists/>
<section id="strings" thinBrackets="false">
<family>orchestral-strings</family>
</section>
<family>keyboards</family>
<unsorted/>
</Order>
</museScore>