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.35k stars 2.67k forks source link

Multichannel instruments don't select correct midi preset for tremolo on SF2 fonts #21122

Open manolo opened 10 months ago

manolo commented 10 months ago

Issue type

General playback bug

Bug description

Violin has 3 channels in instruments.xml Screenshot 2024-01-21 at 14 23 19

But if I use a 3rd party SF2 font like the attached violin.sf2 (attached below) which have preset for tremolo as shown in the Polyphone editor:

Screenshot 2024-01-21 at 15 52 02

If you select that font, and configure automatic bank selection Screenshot 2024-01-21 at 15 59 18

And you mark some of the notes in the part with pizz. tremolo and arco:

Screenshot 2024-01-21 at 16 33 14

You can listen arco and pizzicato sounds, but not tremolo which is played as the default arco sound

Either tremolo-text or tremolo-symbol should select the correct '44' program in the bank, in the same way that pizzicato selects the '45' one.

Steps to reproduce

  1. Install the attached font in your musescore instance Attached inside a zip file since GH does not allow .sf2 violin-sf2.zip
  2. Open attached musescore file Attached inside a zip file since GH does not allow .mscz violin-musescore.zip
  3. Select Violin in first staff using Muse Sounds and play it, you can check that arco, tremolo and pizz works fine
  4. Select Violin in second staff using MS Basic sound font, and you can check that tremolo does not work
  5. Select third staff which is using the provided font, and you can realise that tremolo does not select the bank preset

Screenshots/Screen recordings

In the following video, the first play is using Muse Sounds, and tremolo are correctly played. When using MS Basic or the custom SF2 file, tremolo text is not played, whereas tremolo-symbol is synthetically played looping the arco sound instead of selecting the appropriate bank preset specified by the violin entry in instruments.xml file.

https://github.com/musescore/MuseScore/assets/161853/842c7168-9deb-42cf-9ec2-5c6498c127bc

MuseScore Version

4.2.0

Regression

I don't know

Operating system

Mac

Additional context

No response

cbjeukendrup commented 10 months ago

Note: I believe nowadays the channel data from instruments.xml is currently not actually used for playback. Instead, the data from this gorgeous header file is used: https://github.com/musescore/MuseScore/blob/master/src/framework/audio/internal/synthesizers/fluidsynth/soundmapping.h

manolo commented 10 months ago

But still that file looks well configured, pointing to the correct '44' program/preset in the bank for the tremolo:

Screenshot 2024-01-21 at 21 21 36