Skip to content

Commit

Permalink
Use General MIDI Percussion as the standard drumset
Browse files Browse the repository at this point in the history
The standard drumset is used for unknown percussion instruments found
when importing MIDI or MusicXML, or opening a pre-3.6 MSCX file.

Also run the Python script to fetch the latest instrument data, which
now includes custom noteheads for some percussion instruments.
  • Loading branch information
shoogle committed Jan 23, 2025
1 parent bef3612 commit f688f2f
Show file tree
Hide file tree
Showing 7 changed files with 1,273 additions and 366 deletions.
967 changes: 715 additions & 252 deletions share/instruments/instruments.xml

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions share/instruments/instrumentsxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -3871,31 +3871,31 @@ QT_TRANSLATE_NOOP3("engraving/instruments", "Cuica", "cuica longName"),
//: shortName for Cuica; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Cu.", "cuica shortName"),

//: description for Large Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Drum Kit.", "drumset description"),
//: trackName for Large Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Large Drum Kit", "drumset trackName"),
//: longName for Large Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: description for Drum Kit (large); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Large drum kit.", "drumset description"),
//: trackName for Drum Kit (large); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Drum Kit (large)", "drumset trackName"),
//: longName for Drum Kit (large); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Drum Kit", "drumset longName"),
//: shortName for Large Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: shortName for Drum Kit (large); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "D. Kit", "drumset shortName"),

//: description for 4-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "4 piece drum kit.", "drum-kit-4 description"),
//: trackName for 4-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "4-Piece Drum Kit", "drum-kit-4 trackName"),
//: longName for 4-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: description for Drum Kit (minimal); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Minimal drum kit, 4-piece.", "drum-kit-4 description"),
//: trackName for Drum Kit (minimal); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Drum Kit (minimal)", "drum-kit-4 trackName"),
//: longName for Drum Kit (minimal); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Drum Kit", "drum-kit-4 longName"),
//: shortName for 4-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: shortName for Drum Kit (minimal); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "D. Kit", "drum-kit-4 shortName"),

//: description for 5-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "5 piece drum kit.", "drum-kit-5 description"),
//: trackName for 5-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "5-Piece Drum Kit", "drum-kit-5 trackName"),
//: longName for 5-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: description for Drum Kit (common); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Common drum kit, 5-piece.", "drum-kit-5 description"),
//: trackName for Drum Kit (common); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Drum Kit (common)", "drum-kit-5 trackName"),
//: longName for Drum Kit (common); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Drum Kit", "drum-kit-5 longName"),
//: shortName for 5-Piece Drum Kit; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: shortName for Drum Kit (common); Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "D. Kit", "drum-kit-5 shortName"),

//: description for Field Drum; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
Expand Down Expand Up @@ -4240,13 +4240,13 @@ QT_TRANSLATE_NOOP3("engraving/instruments", "Maracas", "maracas longName"),
//: shortName for Maracas; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Mrcs.", "maracas shortName"),

//: description for Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: description for Mixed Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Orchestral percussion drumset.", "percussion description"),
//: trackName for Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Percussion", "percussion trackName"),
//: longName for Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: trackName for Mixed Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Mixed Percussion", "percussion trackName"),
//: longName for Mixed Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Percussion", "percussion longName"),
//: shortName for Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
//: shortName for Mixed Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Perc.", "percussion shortName"),

//: description for Quijada; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
Expand Down Expand Up @@ -4339,6 +4339,15 @@ QT_TRANSLATE_NOOP3("engraving/instruments", "Whip", "whip longName"),
//: shortName for Whip; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Wh.", "whip shortName"),

//: description for General MIDI Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "General MIDI percussion kit with Level 2 extensions.", "percussion-synthesizer description"),
//: trackName for General MIDI Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "General MIDI Percussion", "percussion-synthesizer trackName"),
//: longName for General MIDI Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Percussion", "percussion-synthesizer longName"),
//: shortName for General MIDI Percussion; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Perc.", "percussion-synthesizer shortName"),

// Percussion - Marching
QT_TRANSLATE_NOOP("engraving/instruments/group", "Percussion - Marching"),

Expand Down Expand Up @@ -4776,15 +4785,6 @@ QT_TRANSLATE_NOOP3("engraving/instruments", "Ondes Martenot", "ondes-martenot lo
//: shortName for Ondes Martenot; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "O.M.", "ondes-martenot shortName"),

//: description for Percussion Synthesizer; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Percussion synthesizer.", "percussion-synthesizer description"),
//: trackName for Percussion Synthesizer; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Percussion Synthesizer", "percussion-synthesizer trackName"),
//: longName for Percussion Synthesizer; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Percussion Synthesizer", "percussion-synthesizer longName"),
//: shortName for Percussion Synthesizer; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Perc. Syn.", "percussion-synthesizer shortName"),

//: description for Atmosphere Synthesizer; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
QT_TRANSLATE_NOOP3("engraving/instruments", "Atmosphere synth effect (General MIDI program 100).", "atmosphere-synth description"),
//: trackName for Atmosphere Synthesizer; Please see https://github.com/musescore/MuseScore/wiki/Translating-instrument-names
Expand Down
11 changes: 10 additions & 1 deletion share/instruments/update_instruments_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def eprint(*args, **kwargs):
'GM+GS_Percussion': '1216482735',
}

standard_drumset_id = 'drumset'
standard_drumset_id = 'percussion-synthesizer' # General MIDI Percussion (most generic kit)

parser = argparse.ArgumentParser(description='Fetch the latest spreadsheet and generate instruments.xml.')
parser.add_argument('-c', '--cached', action='store_true', help='Use cached version instead of downloading')
Expand Down Expand Up @@ -304,6 +304,15 @@ def to_list(str):
if pitch in gmgs_percussion:
to_comment(d_el, gmgs_percussion[pitch], 'name')
to_subelement(d_el, drum, 'head')

noteheads_el = ET.Element('noteheads')
to_subelement(noteheads_el, drum, 'quarter')
to_subelement(noteheads_el, drum, 'half')
to_subelement(noteheads_el, drum, 'whole')
to_subelement(noteheads_el, drum, 'breve')
if noteheads_el.find('*') is not None:
d_el.append(noteheads_el)

to_subelement(d_el, drum, 'line')
to_subelement(d_el, drum, 'voice')
to_subelement(d_el, drum, 'drum', 'name')
Expand Down
Loading

0 comments on commit f688f2f

Please sign in to comment.