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
11.79k stars 2.56k forks source link

Playback support for dynamics - voice priority fixes #23355

Open avvvvve opened 5 days ago

avvvvve commented 5 days ago

@RomanPudashkin follow-up to #23247

There's a bit of an issue with how dynamics at the same beat position interact. The 'Apply to voice' property should affect playback in this priority order:

  1. Highest priority: Individual voice dynamics (1, 2, 3, or 4), which should only affect the staff they are applied to
  2. 'All > All voices on this staff only'
  3. 'All > All voices on instrument' (basically, this is the fallback dynamic for voices that aren't affected by a dynamic with one of the above settings at this exact beat position)

See this example:

image

The 'Apply to voice' property is set as follows: mf is set to 'Voice 1' f is set to 'All > All voices on instrument' p is set to 'All > All voices on this staff only'

Expected behavior

Check for individual voice dynamics Voice 1 in the right hand is played at mf

Check for 'All > All voices on this staff only' dynamics All voices in the left hand are played at p

Apply the 'All > All voices on instrument' dynamic to any remaining voices Voice 2 in the right hand is played at f

Current behavior

The dynamic that is applied changes depending on the order in which they are added. It seems as though if you apply an 'All > All voices on instrument' dynamic last after setting other dynamics in other voices, the 'All' dynamic overwrites any other dynamic.

The goal of this priority order is to make playback predictably the same regardless of the order dynamics are added.