lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix 1569: Bad behavior of NoteNames context (issue4312043)


From: Carl . D . Sorensen
Subject: Fix 1569: Bad behavior of NoteNames context (issue4312043)
Date: Tue, 22 Mar 2011 22:32:38 +0000

Reviewers: ,

Message:
Here's a proposed patch for Issue 1569.

Please review.

Thanks,

Carl


Description:
Fix 1569:  Bad behavior of NoteNames context
  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

Please review this at http://codereview.appspot.com/4312043/

Affected files:
  M Documentation/notation/spacing.itely
  M input/regression/note-names.ly
  M ly/engraver-init.ly


Index: Documentation/notation/spacing.itely
diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index 8c2edce2d5c0b507271dc2223b69496978eb04ae..00901e7e2ec4fac000c92a7e1e96351d1bd0baee 100644
--- a/Documentation/notation/spacing.itely
+++ b/Documentation/notation/spacing.itely
@@ -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.
-
address@hidden TODO: verify last clause below ("even if other...")
+a non-staff line to be treated as a staff.  Setting
address@hidden 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
address@hidden 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: input/regression/note-names.ly
diff --git a/input/regression/note-names.ly b/input/regression/note-names.ly
index 2c756679a39b997fec252603242fb6f7112ecd0b..615b37a3c8fcc8aadeb1b548a696f4ac54be9085 100644
--- a/input/regression/note-names.ly
+++ b/input/regression/note-names.ly
@@ -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: ly/engraver-init.ly
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 0720893ffc725fb0157dcab101b54310dcb48612..aeb379d574260ef05d767db24b3fabd6866427a7 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -461,8 +461,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"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]