musescore / musescore/MuseScore
Add options for default horizontal offsets of hairpins
@davidstephengrant is already working on this.
Since Jul 16, 2026.
- Dominant language
- C++
- Stars
- 15.1k
- Forks
- 3.3k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 91
Description
Hairpins would benefit from options to customise where they start and end relative to their attachment points.
We need a section for defining offsets for both the start and the end of hairpins.
Hairpins can start on a chord, or (once we implement it), a subdivision of a chord's duration.
Hairpins can end on a chord, or (likewise) a subdivision of a chord's duration, or a barline, or a rest.
A hairpin may also start/end where another hairpin ends/starts, which may require specific offsets and padding.
We'll need default options for the offsets for each of these. For now we're primarily considering chords, specifically. Here, for the left and right endpoints, we need at least these options:
- at left of notehead
- at right of notehead
as well as an offset, in sp, which is applied on top of the starting point determined by the above.
(This could be implemented instead using the options available for tuplets - see Style > Tuplets - but the point there is that the placement can differ according to whether the tuplet endpoints are at the stem or notehead end. That makes sense for tuplets since they are clearly associated with specific notes in a specific voice. This is much less clearcut with dynamics, which frequently apply to a whole stave - or two staves! - with any number of voices. In other words, it's not always obvious which voice the hairpin should be placed relative to. One could consider adding an 'at stem' option to the above two, i.e. meaning left or right of chord depending on stem direction, but the logic could then become quite gnarly to work out.)
Where there is a dynamic at either end, the hairpin endpoint will be positioned relative to the dynamic, irrespective of these options.
When adding hairpins, MuseScore considers these as starting on the first note and continuing to the end of the last note, which is (for now) basically equivalent to the start of the following note. That means that when we talk about configuring the position of the end of a hairpin, we're talking about its position relative to the note after the last note to which it was applied. So, in the following examples, the hairpin has been added to the first three notes, but the right-hand endpoint is relative to the fourth note.
MuseScore's current default is to start at the left of the first notehead and end 1sp before the last notehead, i.e. with the suggested system the right endpoint would be 'left of notehead' with an offset of 1sp.

One large publisher uses a style where hairpins start just after the first notehead and end just after the last one, so: start on left of notehead, end on left of notehead, ~0.25sp offset each side:

A very objective mid-20th-C-ish style would be to start at the left of the first notehead and end at the right of the last one:

Note that 'left' and 'right of notehead' refer to the primary notehead, not to any offset seconds; this hairpin starts at 'right of notehead' and ends at 'left of notehead':

We should also add a style setting for the distance between the end of a hairpin and a barline:

(I guess this is 1sp currently)
And, similarly, an offset for hairpins which end on a rest.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.