Jump to content

Automatic spacing behavior: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m New category
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
By default, LilyPond takes stem directions and head positions into account to correctly handle optical spacing. This feature is what makes LilyPond-engraved scores so beautiful to see, to read, and to play :-)
By default, LilyPond takes stem directions and head positions into account to correctly handle optical spacing. This feature is what makes LilyPond-engraved scores so beautiful to see, to read, and to play :-)


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=270
%% http://lsr.di.unimi.it/LSR/Item?id=270


Line 39: Line 39:
[[Category:Staff notation]]
[[Category:Staff notation]]
[[Category:Really cool]]
[[Category:Really cool]]
[[Category:Snippet]]

Latest revision as of 23:33, 21 November 2025

By default, LilyPond takes stem directions and head positions into account to correctly handle optical spacing. This feature is what makes LilyPond-engraved scores so beautiful to see, to read, and to play :-)

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=270

music = {
  c'4 e''4 e'4 b'4 |
  \stemDown
  b'8[ e'' a' e'']
  \stemNeutral
  e'8[ e'8 e'8 e'8]  
}

\score {
  \music
  \layout {
    \context {
      \Staff
      \override NoteSpacing.stem-spacing-correction = #0.6
    }
  }
}

\score {
  \music
  \layout {
    \context {
      \Staff
      \override NoteSpacing.stem-spacing-correction = #0.0
      \override NoteSpacing.same-direction-correction = #0.0
      \override StaffSpacing.stem-spacing-correction = #0.0
    }
  }
}