New cascading instrument definition
Werner recently committed a new architecture for the instrument list files. The instrument list files provide instrument name and characteristics for the new score wizard. The implementation in MuseScore 1.2 had several drawbacks, especially for internationalization. A translator had to translate the full instrument file. If an instrument characteristic such as the range had to be changed in the main file, the english one, then all the translated version had to be changed as well. The new scheme has been implemented to overcome this problem and Werner called it Cascading Instrument Definition in reference to CSS (Cascading Style Sheet).
How Cascading Instrument List works
There is one main default file in english, instruments.xml. This file is always loaded. The file is still very similar in structure to the one in MuseScore 1.2 described here. The main difference is that each instrument has an identifier “id”. Also note the different encoding of clefs. This file also contains informations about the way to play articulations, and could be extended further for legato etc...
The identifier is used as a key in the language specific file. Check the provided template
In this file, each instrument is identified with the id, and the translator just has to translate the name. This file can also be extended with specific instruments for the language or country using the same syntax that the main file. The second file can override all instrument properties. Only the grouping of instruments cannot be changed (no group or instrument can be deleted)
Both files location can be specified in Preferences -> Score. The default instrument list is loaded by default from MuseScore binary for best performance. (thus the path starting by :)
MusicXML 3.0 sound
Currently the ids are MuseScore specific. MusicXML 3.0 made a great effort to come up with a list of instruments, and a hierarchical id for them.
We could use them instead of our own ids when applicable. It would make it easier to export sound details to MusicXML, and maybe also import. But it involves a huge work of manual mapping or constructing manually a new instrument list based on the MusicXML 3.0 list. Anyone interested to help us? Comment here or join us on IRC (#musescore on freenode.net)
Load the language file of system language by default
The second instrument list file being language specific, it could be set by default to the system language. Non english speakers are often surprised when they open the new score wizard to find the list of instruments in english.
We will need to organize the translation of the instrument long and short names. This translation could be done like it used to, by translating the XML file. But it could also be the occasion to make something better.
We had two ideas:
- Integrate the translation into the translation server : http://translate.musescore.org. This will centralize the translation work for the software interface on this server. We will need some code to convert the XML file back and forth to a format the translate server can understand (po files).
- Integrate the translation to MuseScore.org. We could create one page per instrument and ask translators to translate the page or add the translation on the page. Each instrument page could become a wiki page, with information on the instrument from the instrument list (range, clef, MIDI program) but also with external information from Wikipedia, link to soundfonts etc... This approach is interesting for SEO (Search engine optimisation): It will bring more people to MuseScore.org and then MuseScore. By diluting the translation process, we could end up with a slower translation process though. This approach needs some development to automatically create pages on musescore.org from the instruments.xml file, also delete/add new instrument if the file is updated. We also need a way to generate the per language instrument files out of the online pages.