]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 1569: Bad behavior of NoteNames context
authorCarl Sorensen <c_sorensen@byu.edu>
Tue, 22 Mar 2011 22:10:46 +0000 (16:10 -0600)
committerCarl Sorensen <c_sorensen@byu.edu>
Sat, 26 Mar 2011 04:41:47 +0000 (22:41 -0600)
  Changed default value of 'staff-affinity to #UP
  Changed default spacing parameters to be the same as for Lyrics
  context

  Added some documentation about spacing of nonstaff lines to help
  users better understand nonstaff line spacing.

  Added regression test file

Documentation/notation/spacing.itely
input/regression/note-names.ly
ly/engraver-init.ly

index 8c2edce2d5c0b507271dc2223b69496978eb04ae..00901e7e2ec4fac000c92a7e1e96351d1bd0baee 100644 (file)
@@ -1967,9 +1967,9 @@ set to @code{UP} should not immediately follow one that is set to
 @code{DOWN}; those at the bottom should use @code{UP}.  Setting
 @code{staff-affinity} for a staff causes it to be treated as a
 non-staff line.  Setting @code{staff-affinity} to @code{#f} causes
-a non-staff line to be treated as a staff.
-
-@c TODO: verify last clause below ("even if other...")
+a non-staff line to be treated as a staff.  Setting
+@code{staff-affinity} to @code{UP}, @code{CENTER}, or @code{DOWN}
+causes a staff to be spaced as a non-staff line.
 
 @item nonstaff-relatedstaff-spacing
 The distance between the current non-staff line and the nearest
@@ -1979,7 +1979,12 @@ either @code{UP} or @code{DOWN}.  If @code{staff-affinity} is
 @code{CENTER}, then @code{nonstaff-relatedstaff-spacing} is used
 for the nearest staves on @emph{both} sides, even if other
 non-staff lines appear between the current one and either of the
-staves.
+staves.  This means that the placement of a non-staff line depends
+on both the surrounding staves and the surrounding non-staff lines.
+Setting the @code{stretchability} of one of these types of spacing to
+a small value will make that spacing dominate.  Setting the
+@code{stretchability} to a large value will make that spacing have
+little effect.
 
 @item nonstaff-nonstaff-spacing
 The distance between the current non-staff line and the next
index 2c756679a39b997fec252603242fb6f7112ecd0b..615b37a3c8fcc8aadeb1b548a696f4ac54be9085 100644 (file)
@@ -1,27 +1,37 @@
-\version "2.13.38"
+\version "2.13.56"
 
 \header {
-  texidoc = "Various languages are supported for note names input.
-Selecting another language within a music expression is possible,
-and doesn't break point-and-click abilities.
-"
-}
 
+  texidoc = "
+    NoteNames context should be close to the related notes,
+    and should not collide with the tempo markings.
+  "
+}
 
-%% Old syntax.
-\include "english.ly"
+\paper {
+  system-system-spacing
+    #'basic-distance = #10 % increase this value for more space
+}
 
-\relative c'' {
-  g4 bf d c
+notes = \relative c {
+  c'4 c c c
+}
 
-  %% Manual override of the pitchnames variable
-  %% and the parser note names:
-  #(begin
-    (set! pitchnames (ly:assoc-get 'nederlands language-pitch-names))
-    (ly:parser-set-note-names parser pitchnames))
-  bes4 a g fis
+mylyrics = \lyricmode {
+  \tempo "Allegro"
+  ly -- ric ly -- ric
+}
 
-  %% The \language command acts in the same way:
-  \language "italiano"
-  sol4 fa mib re
+\score {
+  <<
+    \new Voice = "voice" {
+      \repeat unfold 13 \notes
+    }
+    \context NoteNames  {
+      \repeat unfold 13 \notes
+    }
+    \new Lyrics \lyricsto "voice" {
+      \repeat unfold 13 \mylyrics
+    }
+  >>
 }
index 5a73bbb9cd5132e1ab2863824681eef14e1e257a..8cfd9db44ca4e969cd52e40d115cac00525c1288 100644 (file)
@@ -465,8 +465,18 @@ printing of a single line of lyrics."
   \description "A context for printing the names of notes."
   \consists "Axis_group_engraver"
 
-  % FIXME: not sure what the default should be here.
-  \override VerticalAxisGroup #'staff-affinity = #DOWN
+  \override VerticalAxisGroup #'staff-affinity = #UP
+  \override VerticalAxisGroup #'nonstaff-nonstaff-spacing =
+    #'((basic-distance . 0)
+       (minimum-distance . 2.8)
+       (padding . 0.2)
+       (stretchability . 0))
+  \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
+    #'((basic-distance . 5.5)
+       (padding . 0.5)
+       (stretchability . 1))
+  \override VerticalAxisGroup
+    #'nonstaff-unrelatedstaff-spacing #'padding = 1.5
 
   \consists "Tie_engraver"
   \consists "Note_name_engraver"