Slurs with stemless note heads

Revision as of 11:32, 6 March 2026 by Gabriel Ellsworth (talk | contribs) (Created page with "If you do not want your notes to have stems, <code>\omit Stem</code> is very useful. But you may find that LilyPond positions the start or end points of some slurs incorrectly. By setting <code>\override NoteHead.stem-attachment = #'(0 . 0)</code> you can move the stem attachment point to the center of the note head, which results in better slur positioning for stemless note heads. Source of music: [https://archive.org/details/manualofgregoria00dela/page/266/mode/1up A...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

If you do not want your notes to have stems, \omit Stem is very useful. But you may find that LilyPond positions the start or end points of some slurs incorrectly.

By setting \override NoteHead.stem-attachment = #'(0 . 0) you can move the stem attachment point to the center of the note head, which results in better slur positioning for stemless note heads.

Source of music: A manual of Gregorian chant compiled from the Solesmes books and from ancient manuscripts.

\version "2.24"

chant = \relative c' {
  \key d \dorian
  \slurUp
  
  \time 18/4
  d( a') g( f g) a( bes) a2
  a4 g( f) g( f) d2( f) | \bar ","
  
  \time 17/4 a4 a( g f) g( f a) a2
  a4 c( b g) b( c a2) | \bar "'"
  
  \time 20/4
  d4( c b g) b( c a) ~
  a( g f) g( a d,) ~
  d( c f) e( d) d2 | \bar "||"
}

words = \lyricmode {
  Ad -- o -- ré -- mus
  in ae -- tér -- num
  sanc -- tís -- si -- mum
  Sa -- cra -- _ _ _ _ mén -- tum.
}

% Top-level layout (applying to all scores):
\layout {
  \set Score.forbidBreakBetweenBarLines = ##f
  \omit Score.TimeSignature
  \context {
    \Voice
    \consists Melody_engraver
    \omit Stem
  }
}

scoreContent = << \new Voice = "chant" \chant
   \new Lyrics \lyricsto chant \words >>

\markup { \circle 1 LilyPond’s default: }
\score {
  \scoreContent
}

\markup { \circle 2 With adjustment to stem-attachment: }
\score {
  % score-specific layout:
  \layout {
    \context {
      \Voice
      \override NoteHead.stem-attachment = #'(0 . 0)
    }
  }
  \scoreContent
}