musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.39k stars 2.68k forks source link

[MU4 Issue] Request to add national plucked instruments from Colombia, South America #17323

Open rolodoom opened 1 year ago

rolodoom commented 1 year ago

Hello there. I'm a coder / musician from Colombia, South America. In my country we have some plucked string instruments (Bandolas and Tiple).

I made an XML instrument definition on Github for MuseScore3 but I noticed that it doesn't work on MuseScore4. The definition includes notation and tab version. This is really a bummer 'cause I have a lot of scores already created with this XML.

I asked on discord channel about the issue, and @cbjeukendrup told me to make a request here.

I will be more than grateful and happy to help as this feature would be quite important for me and other musicians from my country!

rolodoom commented 1 year ago

Hello there. I know that there is a lot of stuff for the team to address. Is there any info on how to make this changes on the source code? I mean, I really like to help with this and make it possible to have Colombian instruments on MuseScore. Happy to help in anyway possible.

It's just that it was so simple in MuseScore 3, and know it's like no where to look on documentation to make this customization on MS4.

cbjeukendrup commented 1 year ago

Currently there is no possibility to customise the list of available instruments in MS4. We still want to add back that functionality, but then in a proper way that does not involve fiddling with XML files and that does not break playback 😄 (because that was one of the reasons that we excluded it from MS4: it didn't work together with the new playback system, because those custom instruments don't always have a proper instrument ID tag).

Anyway, so for now, instruments will really need to be added into MuseScore itself. Currently, that needs to be done via this spreadsheet: https://docs.google.com/spreadsheets/d/1SwqZb8lq5rfv5regPSA10drWjUAoi65EuMoYtG-4k5s/edit#gid=516529997 But only @shoogle can edit that. If you could provide the data for all the columns with a yellow header, Peter can put them in the spreadsheet. (Edit: I see you already provided the data in the topmost comment here 🙂)

cbjeukendrup commented 1 year ago

There is one temporary workaround that you can try, although it's a bit risky. You could try to edit the instruments.xml file that is packaged with MuseScore itself. You probably installed MuseScore to C:\Program files\MuseScore 4 (assuming you use Windows). Inside that folder, there should be a folder called instruments. This folder contains the instruments.xml file. You can try to edit it with a text editor to add more instruments. But be sure to keep a backup of the original version of this file before saving changes to it, so that you can easily go back if necessary.

Jojo-Schmitz commented 1 year ago

Isn't that file built-in into MuseScore

cbjeukendrup commented 1 year ago

No, this one not, see share/instrument/CMakeLists.txt

Jojo-Schmitz commented 1 year ago

Doesn't mean much, it was there in Mu3 too, but Mu3 used the builtin one instead

cbjeukendrup commented 1 year ago

It doesn't appear in any .qrc file, so isn't built-in

rolodoom commented 1 year ago

@cbjeukendrup Thanks for your response. Actually a I use the official AppImage on Manjaro Linux. Hope you can point me to the instruments.xml on Linux Systems.

shoogle commented 1 year ago

@rolodoom, on Linux instruments.xml is inside the AppImage so editing is more tricky. If you really want to exit it, here's how:

Details (click to show/hide)
First, extract the AppImage: ``` ./MuseScore*.AppImage --appimage-extract ``` This will create a folder called `squashfs-root` in the current directory. Look for this file and edit as required: ``` squashfs-root/share/instruments/instruments.xml ``` Editing the files in `squashfs-root` won't affect the original AppImage, but you can test your changes in the extracted version by running: ``` squashfs-root/AppRun ``` You can pass in options for MuseScore like this: ``` squashfs-root/AppRun --help squashfs-root/AppRun score.mscz -o score.pdf ``` If you want to turn `squashfs-root` back into an AppImage, you would need [`appimagetool`](https://github.com/AppImage/AppImageKit/releases/tag/13): ``` ./appimagetool-x86_64.AppImage squashfs-root MuseScoreCustom-x86_64.AppImage ```
MarcSabatella commented 1 year ago

Depending on the situation, a simpler workaround might be to just create a score where you've created those instruments manually (adding a guitar and customizing its properties), then save that to your template folder. Then you can select that template when starting a new score, and add whatever other instruments need afterwards.

rolodoom commented 1 year ago

Depending on the situation, a simpler workaround might be to just create a score where you've created those instruments manually (adding a guitar and customizing its properties), then save that to your template folder. Then you can select that template when starting a new score, and add whatever other instruments need afterwards.

Actually this is not a workaround. I already did it and found that names on the mixer wont change, so it's super confusing on large scores (#18985)

I found like a solution to make my templates:

  1. Extract the *.mscz to a folder
  2. Open the *.mscx with a text editor
  3. Change the name on the first appearance of <trackName></trackName>
  4. Now I can open in MuseScore and save it a *.mscz
  5. And then use this file to make a Template.

Screenshot_20230810_081433

But as I said earlier, this was so much easier on MS3 using my custom xml definitions.

rolodoom commented 1 year ago

@shoogle I will test the method on your answer. Thanks

rolodoom commented 1 year ago

@rolodoom, on Linux instruments.xml is inside the AppImage so editing is more tricky. If you really want to exit it, here's how: Details (click to show/hide)

I just tested, and the instruments are working but there is no mixer track and no sound. I made the modifications based on an existing similar spanish instrument called Bandurria. Here is what I did:

  1. Follow the steps you gave me and open the file, that actually was on another location in the mscore4portable-4.1 folder inside share:
squashfs-root/share/mscore4portable-4.1/instruments/instruments.xml
  1. Added a Family:

    <Family id="bandolas">
    <name>Bandolas</name>
    </Family>
  2. Added both instruments (standard and Tablature) inside the plucked-strings Instrument Group:

<InstrumentGroup id="plucked-strings">
    <name>Strings - Plucked</name>
    ...

    <Instrument id="bandola">
        <family>bandolas</family>
        <trackName>Bandola</trackName>
        <longName>Bandola</longName>
        <shortName>Bnd.</shortName>
        <description>Colombian folk instrument similar to the mandolin. (Staff notation)</description>
        <musicXMLid>pluck.bandola</musicXMLid>
        <StringData>
            <frets>17</frets>
            <string>54</string>
            <string>59</string>
            <string>64</string>
            <string>69</string>
            <string>74</string>
            <string>79</string>
        </StringData>
        <clef>G</clef>
        <barlineSpan>1</barlineSpan>
        <aPitchRange>54-84</aPitchRange>
        <pPitchRange>52-96</pPitchRange>
        <singleNoteDynamics>0</singleNoteDynamics>
        <Channel>
            <!--MIDI: Bank 0, Prog 25; MS General: Steel String Guitar-->
            <program value="25"/> <!--Acoustic Guitar (steel)-->
        </Channel>
        <genre>popular</genre>
    </Instrument>
    <Instrument id="bandola-tablature">
        <init>bandola</init>
        <family>bandolas</family>
        <trackName>Bandola (tablature)</trackName>
        <longName>Bandola</longName>
        <description>Colombian folk instrument similar to the mandolin. (Tablature)</description>
        <musicXMLid>pluck.bandola</musicXMLid>
        <stafftype staffTypePreset="tab6StrCommon">tablature</stafftype>
        <genre>popular</genre>
    </Instrument>

    ...
</InstrumentGroup>
  1. Tested changes using ./AppRun inside the squashfs-root. The instrument its working but there is no mixer track and no sound. Here I add a screencapture.

Screenshot_20230810_095612

What am I missing? Is there any additional change for the mixer part?? As I said before, I based the code on the original Bandurria definitions.

shoogle commented 1 year ago

@rolodoom, sadly the sounds are no longer defined in intruments.xml but in the program source code. See the changes to files in src in PR #14747 for an example.

That would explain the lack of default sounds, but I would still expect to see tracks for these instruments in the Mixer so that you could assign your own sound. Presumably whoever wrote the Mixer code didn't have this eventuality in mind, or perhaps there is a technical reason why every instrument requires a default sound.