-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate standard drumset from online instruments spreadsheet
The spreadsheet is the source of truth for all instrument data except: * Some text (e.g. drum names) in src/engraving/types/typesconv.cpp. * Playback data for Muse Sounds and MS Basic.
- Loading branch information
Showing
4 changed files
with
390 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,103 @@ | ||
# Instruments list | ||
# Instruments | ||
|
||
The list of instruments is stored in this online spreadsheet: | ||
https://docs.google.com/spreadsheets/d/1SwqZb8lq5rfv5regPSA10drWjUAoi65EuMoYtG-4k5s/edit#gid=516529997 | ||
## About the online spreadsheet | ||
|
||
When changes have been made to this spreadsheet, please run `update_instruments_xml.py`, | ||
to update the following files: | ||
- `instruments.xml` (used by MuseScore, to load the instruments); | ||
- `instrumentsxml.h` (a fake header file used to generate translatable strings from; | ||
see also `/tools/translations/run_lupdate.sh`). | ||
Instrument data is stored in this [Google spreadsheet][Instruments], which | ||
contains multiple worksheets (aka. 'sheets' or 'tabs') for different data: | ||
|
||
- [Instruments] | ||
- [Channels] | ||
- [Basics] | ||
- Etc. | ||
|
||
[Instruments]: https://docs.google.com/spreadsheets/d/1SwqZb8lq5rfv5regPSA10drWjUAoi65EuMoYtG-4k5s/edit#gid=516529997 | ||
[Channels]: https://docs.google.com/spreadsheets/d/1SwqZb8lq5rfv5regPSA10drWjUAoi65EuMoYtG-4k5s/edit#gid=504647632 | ||
[Basics]: https://docs.google.com/spreadsheets/d/1SwqZb8lq5rfv5regPSA10drWjUAoi65EuMoYtG-4k5s/edit#gid=457195594 | ||
|
||
Some sheets are hidden and only accessible via the View menu to those with | ||
permission. The hidden sheets contain mostly third-party data that is unlikely | ||
to change, such as constants from the General MIDI specification. Hiding these | ||
sheets is purely a matter of convenience. | ||
|
||
## Editing the spreadsheet | ||
|
||
Community members can create issues or comment on the visible sheets to request | ||
changes. Team members can request permission to edit the spreadsheet directly | ||
if required. | ||
|
||
Anybody can make an editable copy of the spreadsheet on their own Google Drive, | ||
or download it in a variety of formats (Excel, ODS, CSV, etc.). | ||
|
||
## Updating local files | ||
|
||
After you make changes to any of the spreadsheet sheets, run the Python script | ||
`update_instruments_xml.py` to update the following files in the repository: | ||
|
||
- `instruments.xml` - Used by MuseScore Studio to load most instrument data. | ||
|
||
- `instrumentsxml.h` - A fake header file used to generate translatable strings | ||
(see also `tools/translations/run_lupdate.sh`). | ||
|
||
- `src/engraving/dom/drumset.cpp` - A C++ source file that contains the | ||
standard drumset used to initialize MuseScore Studio's MIDI and playback | ||
systems at startup, prior to `instruments.xml` being loaded. | ||
|
||
Commit the changes to these files and submit them in a PR. | ||
|
||
## Using cached data | ||
|
||
If you're running the Python script repeatedly (e.g. during development), you | ||
can use the script's `-c` or `--cached` option in combination with the `-d` or | ||
`--download` option to avoid downloading the entire spreadsheet each time. | ||
|
||
For example, this will download only the [Instruments] and [Channels] sheets, | ||
while using cached data for all the other sheets: | ||
|
||
```Bash | ||
./update_instruments_xml.py --cached --download Instruments --download Channels | ||
./update_instruments_xml.py -c -d Instruments -d Channels | ||
``` | ||
|
||
See the script's `-h` or `--help` option for more details. | ||
|
||
Make sure that you run the script once with no options as a final step before | ||
submitting a PR. This ensures you're using the latest data from all sheets. | ||
|
||
## Ignoring other people's changes | ||
|
||
If somebody else has edited the spreadsheet, and their changes are showing in | ||
the diff after you run the Python script, you can use the `-p` or `--patch` | ||
option to `git add` to avoid committing their changes. | ||
|
||
```Bash | ||
git add -p . | ||
git add --patch . | ||
``` | ||
|
||
This triggers an [interactive staging session], where Git shows you each | ||
distinct 'hunk' (or region) of diff and asks whether you want to 'stage' it | ||
(i.e. add it to the index) ready to be committed. | ||
|
||
[interactive staging session]: https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging#_staging_patches | ||
|
||
You can respond with: | ||
|
||
- `y` - Yes, stage this hunk (in order to commit it). | ||
- `n` - No, don't stage this hunk (i.e. exclude it from the commit). | ||
- `?` - Help, show [more patch options]. | ||
|
||
[more patch options]: https://git-scm.com/docs/git-add#Documentation/git-add.txt-patch | ||
|
||
After responding `y` (yes) to all your hunks and `n` (no) to everyone else's, | ||
you can go ahead and create the commit with `git commit`. Use `git checkout .` | ||
if you want to remove the unstaged changes from the working tree. | ||
|
||
## Justification | ||
|
||
The main advantage of the spreadsheet is the speed and convenience with which | ||
we can make large-scale changes to many items at once. Important too is the | ||
ability to quickly look along rows and columns to compare values and check for | ||
errors or inconsistencies. Formulas and formatting also help with these tasks. | ||
|
||
Our reasons for not storing the actual spreadsheet file itself in the | ||
repository are set out [here](https://github.com/musescore/MuseScore/pull/26082#issuecomment-2590711797). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.