Skip to content

Conversation

@manolo
Copy link
Contributor

@manolo manolo commented Nov 10, 2025

Summary

Now string instruments correctly select tremolo MIDI presets when using SF2 soundfonts.

#### Affected mappings:

  • VIOLIN: Added Tremolo8th/16th/32nd/64th → midi::Program(20, 44)
  • VIOLA: Added Tremolo8th/16th/32nd/64th → midi::Program(30, 44)
  • VIOLONCELLO: Added Tremolo8th/16th/32nd/64th → midi::Program(40, 44)
  • CONTRABASS: Added Tremolo8th/16th/32nd/64th → midi::Program(50, 44)

Changes made:

  1. Updated soundmapping.h:
  • Added missing tremolo articulation mappings for individual instruments
    • VIOLIN: Bank 20, Program 44
    • VIOLA: Bank 30, Program 44
    • VIOLONCELLO: Bank 40, Program 44
    • CONTRABASS: Bank 50, Program 44
  1. Updated instruments.xml:
  • Fixed tremolo channel definitions for individual instruments
  • Added proper MIDI Bank LSB controllers (ctrl=32)
  • Aligned individual instruments with their section counterparts
    • violin: Bank 0 → Bank 20
    • viola: Bank 0 → Bank 30
    • violoncello: Bank 0 → Bank 40
    • contrabass: Bank 0 → Bank 50

Resolves: #21122

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)
    • Do not apply because the change only affects configuration lines no logic code and I couldn't see existing tests testing such properties

@cbjeukendrup
Copy link
Member

The samples that would be used by this PR are section samples, not solo, right? As far as I know, we don't have solo tremolo samples.

So a solo violin with tremolo would now use the section tremolo sound. We'll have to ask the design team what they prefer: solo+tremolo just using the solo sound without tremolo (current situation) or solo+tremolo using the section+tremolo sound (this PR).

@MarcSabatella
Copy link
Contributor

FWIW, MU3 and earlier did it this way - section tremolo sounds for solo instrument - and we rarely if ever got complaints. To me it's very clearly preferable.

@manolo
Copy link
Contributor Author

manolo commented Nov 10, 2025

@cbjeukendrup thanks for bringing up this design consideration! You're right that the samples would be section samples, not solo. Using Bank 0, Program 44 (generic tremolo) for individual is perhaps more academic and also would have these advantages:

  • No "hacks" in the instrument configuration files
  • Users can select soundfonts that have the appropriate programs in the correct banks or develop their own.

@MarcSabatella Thanks for the historical context about MU3 behavior

In any way I can adapt my SF2 files for plectro Spanish orchestras to be able to reproduce tremolo correctly.

Would you like me to update the PR to use Bank 0 for individual instruments instead?

@manolo
Copy link
Contributor Author

manolo commented Nov 10, 2025

After investigating the playback code further, the instruments.xml file is no longer used for actual sound mapping. The real playback logic uses soundmapping.h.

I've rolled back changes regardin the .xml file. Now the PR is more concise.

    - Add missing tremolo articulation mappings to individual VIOLIN, VIOLA, VIOLONCELLO, and CONTRABASS
    - Previously only *_SECTION variants had tremolo mappings, causing tremolo to fall back to default arco sound
    - Individual instruments now correctly map tremolo to program 44 on their respective banks (20, 30, 40, 50)
    - Fixes issue musescore#21122: Multichannel instruments don't select correct midi preset for tremolo on SF2 fonts

    Affected mappings:
    - VIOLIN: Added Tremolo8th/16th/32nd/64th → midi::Program(20, 44)
    - VIOLA: Added Tremolo8th/16th/32nd/64th → midi::Program(30, 44)
    - VIOLONCELLO: Added Tremolo8th/16th/32nd/64th → midi::Program(40, 44)
    - CONTRABASS: Added Tremolo8th/16th/32nd/64th → midi::Program(50, 44)

    Now string instruments (violin, viola, violoncello, contrabass) correctly select tremolo MIDI presets when using SF2 soundfonts.

    Changes made:

    1. Updated soundmapping.h:
       - Added missing tremolo articulation mappings for individual instruments
       - VIOLIN: Bank 20, Program 44
       - VIOLA: Bank 30, Program 44
       - VIOLONCELLO: Bank 40, Program 44
       - CONTRABASS: Bank 50, Program 44

    Fixes: musescore#21122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants