]> git.donarmstrong.com Git - lilypond.git/commitdiff
Doc: update staff-padding
authorKeith OHara <k-ohara5a5a@oco.net>
Thu, 5 Sep 2013 06:51:03 +0000 (23:51 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Sat, 21 Sep 2013 05:33:01 +0000 (22:33 -0700)
Documentation/learning/tweaks.itely
Documentation/notation/keyboards.itely
Documentation/notation/spacing.itely
Documentation/snippets/broken-crescendo-hairpin.ly
Documentation/snippets/expressive-headword.ly
Documentation/snippets/new/broken-crescendo-hairpin.ly [new file with mode: 0644]
Documentation/snippets/new/expressive-headword.ly [new file with mode: 0644]
Documentation/snippets/new/pitches-headword.ly [new file with mode: 0644]
Documentation/snippets/new/vertically-aligned-dynamics-and-textscripts.ly [new file with mode: 0644]
Documentation/snippets/pitches-headword.ly
Documentation/snippets/vertically-aligned-dynamics-and-textscripts.ly

index fdb9008721ca788613f1d2b603ac527b23a8873c..5802044e422fafcd91b1c267aca81b33810868d8 100644 (file)
@@ -2703,9 +2703,9 @@ space between any object which supports the
 @code{side-position-interface} and the nearest other object (generally
 the note or the staff lines); @code{staff-padding} applies only to
 those objects which are always set outside the staff -- it controls
-the minimum amount of space that should be inserted between that
-object and the staff.  Note that @code{staff-padding} has no effect on
-objects which are positioned relative to the note rather than the
+the minimum distance from the staff to the outside-staff object.
+Note that @code{staff-padding} has no effect on
+objects that are positioned relative to the note rather than the
 staff, even though it may be overridden without error for such objects
 -- it is simply ignored.
 
@@ -2970,9 +2970,9 @@ note head by overriding @code{right-padding}.
 @cindex objects, aligning on a baseline
 
 @code{staff-padding} can be used to align objects such as dynamics
-along a baseline at a fixed height above the staff, rather than at a
-height dependent on the position of the note to which they are
-attached.  It is not a property of @code{DynamicText} but of
+along a baseline at a fixed distance from the staff, when no other
+notation forces them further from the staff.
+It is not a property of @code{DynamicText} but of
 @code{DynamicLineSpanner}.  This is because the baseline should apply
 equally to @strong{all} dynamics, including those created as extended
 spanners.  So this is the way to align the dynamic marks in the
@@ -2984,12 +2984,8 @@ example taken from the previous section:
 @cindex staff-padding property, example
 
 @lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-\dynamicUp
-% Extend width by 1 unit
-\override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)
-% Align dynamics to a base line 2 units above staff
-\override DynamicLineSpanner.staff-padding = #2
-a4\f b\mf a\mp b\p
+\override DynamicLineSpanner.staff-padding = #3
+a4\f b\mf a\p b\mp
 @end lilypond
 
 
index 1bb79b7c5a32785a6365112d18bbdd5980795229..a8405b5274f29b9008be04c9afbaba92c08b5aa4 100644 (file)
@@ -206,7 +206,7 @@ Overlapping notation can result when voices cross staves:
   \new Staff = "up" {
     \voiceOne
     % Make space for fingering in the cross-staff voice
-    \once\override DynamicLineSpanner.staff-padding = #3.4
+    \once\override DynamicLineSpanner.staff-padding = #4
     e''2\p\< d''\>
     c''1\!
   }
index c85be8386969835c5bf0b318926fb03b07ca12db..2b3299d7419c1c41776055ee33d79a3915e62a27 100644 (file)
@@ -1982,7 +1982,7 @@ given in the following table:
 @item @code{ChordNames}  @tab baseline
 @item @code{NoteNames}   @tab baseline
 @item @code{Lyrics}      @tab baseline
-@item @code{Dynamics}    @tab vertical center
+@item @code{Dynamics}    @tab mid-height of @q{m}
 @item @code{FiguredBass} @tab highest point
 @item @code{FretBoards}  @tab top line
 @end multitable
@@ -2044,10 +2044,10 @@ labelContext =
   \new Lyrics { \lyrics { \skip 1*2 | ghijk1 | } }
 >>
 
-%% The reference point for Dynamics is its vertical center
+%% The reference point for Dynamics is the midline of 'm' in the font
 <<
   \new RhythmicStaff {
-    \set RhythmicStaff.instrumentName = #"vertical center "
+    \set RhythmicStaff.instrumentName = #"mid-height "
     \labelContext "Dynamics" s1*3
   }
   \new Dynamics { s1\mp s\fp }
index 66e83829927af59f32a48b45c3677c84f1a0e579..68960a584034a088585dece16ea64f49fadc32f0 100644 (file)
@@ -1,10 +1,11 @@
-%% DO NOT EDIT this file manually; it is automatically
-%% generated from LSR http://lsr.dsi.unimi.it
-%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
-%% and then run scripts/auxiliar/makelsr.py
-%%
-%% This file is in the public domain.
-\version "2.17.25"
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation/snippets/new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.17.27
+\version "2.17.27"
 
 \header {
   lsrtags = "contemporary-notation, expressive-marks, symbols-and-glyphs"
   texidoc = "
 In order to make parts of a crescendo hairpin invisible, the following
 method is used: A white rectangle is drawn on top of the respective
-part of the crescendo hairpin, making it invisible.  The rectangle is
-defined as postscript code within a text markup.
-
-To fine-tune the position and size of the markup, the number preceding
-@code{setgray} in the postscript definition can be set to a value less
-than one, making it grey.  The two numbers before @code{scale} in the
-postscript code are responsible for the width and height of the
-rectangle, the two numbers before @code{translate} change the x- and
-y-origin of the rectangle.
+part of the crescendo hairpin, making it invisible.
 
+The markup command @code{with-dimensions} tells LilyPond to consider only
+the bottom edge of the rectangle when spacing it against the hairpin.
+The property @code{staff-padding} prevents the rectangle from fitting
+between the hairpin and staff.
 
 Make sure to put the hairpin in a lower layer than the text markup to
 draw the rectangle over the hairpin.
@@ -35,7 +32,6 @@ draw the rectangle over the hairpin.
   <<
     {
       \dynamicUp
-      \override DynamicLineSpanner.staff-padding = #4
       r2 r16 c'8.\pp r4
     }
     \\
@@ -43,18 +39,11 @@ draw the rectangle over the hairpin.
       \override DynamicLineSpanner.layer = #0
       des,2\mf\< ~
       \override TextScript.layer = #2
-      des16_\markup {
-        \postscript #"
-          1.9 -8 translate
-          5 4 scale
-          1 setgray
-          0 0 moveto
-          0 1 lineto
-          1 1 lineto
-          1 0 lineto
-          0 0 lineto
-          fill"
-      }
+      \once\override TextScript.staff-padding = #6
+      \once\override TextScript.vertical-skylines = #'()
+      des16_\markup \with-dimensions #'(2 . 7) #'(0 . 0)
+                    \with-color #white
+                    \filled-box #'(2 . 7) #'(0 . 2) #0
       r8. des4 ~ des16->\sff
     }
   >>
index 8183a4e05046d88fabf6fe86875565397c559b71..b7caf83f1e16aa84bda78e725057fd76559506d7 100644 (file)
@@ -1,10 +1,11 @@
-%% DO NOT EDIT this file manually; it is automatically
-%% generated from LSR http://lsr.dsi.unimi.it
-%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
-%% and then run scripts/auxiliar/makelsr.py
-%%
-%% This file is in the public domain.
-\version "2.17.25"
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation/snippets/new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.17.27
+\version "2.17.27"
 
 \header {
   lsrtags = "headword"
@@ -40,7 +41,7 @@ Expressive headword
       \key g \major
       \time 6/8
       \partial 2
-      \once \override TextScript.staff-padding = #2
+      \once \override TextScript.padding = #2
       d'8 \staccato
       ^ \markup { \column {
          RONDO
diff --git a/Documentation/snippets/new/broken-crescendo-hairpin.ly b/Documentation/snippets/new/broken-crescendo-hairpin.ly
new file mode 100644 (file)
index 0000000..27df944
--- /dev/null
@@ -0,0 +1,42 @@
+\version "2.17.27"
+
+\header {
+  lsrtags = "contemporary-notation, expressive-marks, symbols-and-glyphs"
+
+  texidoc = "
+In order to make parts of a crescendo hairpin invisible, the following
+method is used: A white rectangle is drawn on top of the respective
+part of the crescendo hairpin, making it invisible.
+
+The markup command @code{with-dimensions} tells LilyPond to consider only
+the bottom edge of the rectangle when spacing it against the hairpin.
+The property @code{staff-padding} prevents the rectangle from fitting
+between the hairpin and staff.
+
+Make sure to put the hairpin in a lower layer than the text markup to
+draw the rectangle over the hairpin.
+
+"
+  doctitle = "Broken Crescendo Hairpin"
+}
+
+\relative c' {
+  <<
+    {
+      \dynamicUp
+      r2 r16 c'8.\pp r4
+    }
+    \\
+    {
+      \override DynamicLineSpanner.layer = #0
+      des,2\mf\< ~
+      \override TextScript.layer = #2
+      \once\override TextScript.staff-padding = #6
+      \once\override TextScript.vertical-skylines = #'()
+      des16_\markup \with-dimensions #'(2 . 7) #'(0 . 0)
+                    \with-color #white
+                    \filled-box #'(2 . 7) #'(0 . 2) #0
+      r8. des4 ~ des16->\sff
+    }
+  >>
+}
diff --git a/Documentation/snippets/new/expressive-headword.ly b/Documentation/snippets/new/expressive-headword.ly
new file mode 100644 (file)
index 0000000..1f9cf0f
--- /dev/null
@@ -0,0 +1,268 @@
+\version "2.17.27"
+
+\header {
+  lsrtags = "headword"
+
+  texidoc = "
+Expressive headword
+
+"
+  doctitle = "Expressive headword"
+}
+\include "english.ly"
+
+% NR 1.3 Expressive marks
+
+% L. v. Beethoven, Op. 49 no. 1
+% Piano sonata 19 - "Leichte Sonate"
+% measures 1 - 12
+
+%\layout {
+%   \context {
+%      \Score
+%      \override SpacingSpanner.base-shortest-duration =
+%         #(ly:make-moment 1/20)
+%   }
+%}
+
+\new PianoStaff <<
+
+   % RH Staff
+   \new Staff {
+      \clef treble
+      \key g \major
+      \time 6/8
+      \partial 2
+      \once \override TextScript.padding = #2
+      d'8 \staccato
+      ^ \markup { \column {
+         RONDO
+         \italic Allegro } }
+      d'8 \staccato
+      g'8 \staccato
+      a'8 \staccato
+
+      |
+
+      b'8 [ (
+      g'8 ] )
+      e'8 \staccato
+      e' \staccato
+      a'8 \staccato
+      b'8 \staccato
+
+      |
+
+      c''8 [ (
+      a'8 ] )
+      e''8 \staccato
+      d''8 \staccato
+      c''8 \staccato
+      b'8 \staccato
+
+      |
+
+      a'8 \staccato
+      g'8 \staccato
+      a'8 \staccato
+      \acciaccatura { g'16 [ a'16 ] }
+      bf'8
+      a'8 \staccato
+      g'8 \staccato
+
+      |
+
+      fs'8 [ (
+      d'8 ] )
+      d'8 \staccato
+      d'8 \staccato
+      g'8 \staccato
+      a'8 \staccato
+
+      |
+
+      b'8 [ (
+      g'8 ] )
+      e'8 \staccato
+      e'8 \staccato
+      a'8 \staccato
+      b'8 \staccato
+
+      |
+
+      c''8 [ (
+      a'8 ] )
+      e''8 \staccato
+      d''8 \staccato
+      c''8 \staccato
+      b'8 \staccato
+
+      |
+
+      a'8 \staccato
+      g'8 \staccato
+      a'8 \staccato
+      <<
+         {
+            \voiceOne
+            d'8
+            g'8
+            fs'8
+            \oneVoice
+         }
+         \new Voice {
+            \voiceTwo
+            d'4
+            c'8
+            \oneVoice
+         }
+      >>
+
+      |
+
+      <b g'>4 \tenuto
+      d'8 \staccato
+      g'8 \staccato
+      b'8 \staccato
+      d''8 \staccato
+
+      |
+
+      d''8 (
+      <c'' a'>8 \staccato )
+      <c'' a'>8 \staccato
+      d''8 (
+      <b' g'>8 \staccato )
+      <b' g'>8 \staccato
+
+      |
+
+      d''8 (
+      <c'' a'>8 \staccato )
+      <c'' a'>8 \staccato
+      d''8 (
+      <b' g'>8 \staccato )
+      <b' g'>8 \staccato
+
+      |
+
+      d''8 \staccato
+      <c'' a'>8 \staccato
+      <b' g'>8 \staccato
+      d'' \staccato
+      <c'' a'>8 \staccato
+      <b' g'>8 \staccato
+
+      |
+
+      <d'' c'' a'>4 \fermata
+      r8 r4 r8
+   }
+
+   % LH Staff
+   \new Staff {
+      \clef bass
+      \key g \major
+      \time 6/8
+      \partial 2
+      r8
+      r8
+      <d' b>8 \staccato
+      <c' a>8 \staccato
+
+      |
+
+      <b g>4
+      r8
+      r8
+      <e' c'>8 \staccato
+      <d' b>8 \staccato
+
+      |
+
+      <c' a>4
+      r8
+      r8
+      <a fs>8 \staccato
+      <b g>8 \staccato
+
+      |
+
+      <c' a>8 \staccato
+      <b d'>8 \staccato
+      <e' c'>8 \staccato
+      <e' cs'>4. (
+
+      |
+
+      d'4 )
+      r8
+      r8
+      <d' b!>8 \staccato
+      <c'! a>8 \staccato
+
+      |
+
+      <b g>4
+      r8
+      r8
+      <e' c'>8 \staccato
+      <d' b>8 \staccato
+
+      |
+
+      <c' a>4
+      r8
+      r8
+      <a fs>8 \staccato
+      <b g>8 \staccato
+
+      |
+
+      <c' a>8 \staccato
+      <d' b>8 \staccato
+      <e' c'>8 \staccato
+      <b d>4
+      <a d>8 \staccato
+
+      |
+
+      <g g,>4 \tenuto
+      r8
+      r4
+      r8
+
+      |
+
+      r8
+      <d' fs>8 \staccato
+      <d' fs>8 \staccato
+      r8
+      <d' g>8 \staccato
+      <d' g>8 \staccato
+
+      |
+
+      r8
+      <d' fs>8 \staccato
+      <d' fs>8 \staccato
+      r8
+      <d' g>8 \staccato
+      <d' g>8 \staccato
+
+      |
+
+      r8
+      <d' fs>8 \staccato
+      <d' g>8 \staccato
+      r8
+      <d' fs>8 \staccato
+      <d' g>8 \staccato
+
+      |
+
+      <d' fs>4 \fermata
+      r8 r4 r8
+   }
+
+>>
diff --git a/Documentation/snippets/new/pitches-headword.ly b/Documentation/snippets/new/pitches-headword.ly
new file mode 100644 (file)
index 0000000..70246ce
--- /dev/null
@@ -0,0 +1,137 @@
+\version "2.17.27"
+
+\header {
+  lsrtags = "headword"
+
+  texidoc = "
+Piches headword
+
+"
+  doctitle = "Pitches headword"
+}
+% L. v. Beethoven
+% Piano sonata 21 - Dem Grafen von Waldstein Gewidmet
+% chorale at measures 34 - 40+
+
+\include "english.ly"
+
+\new PianoStaff <<
+
+  % RH Staff
+  \new Staff <<
+
+    % RH Voice 1
+    \new Voice {
+      \set Score.currentBarNumber = #34
+      \voiceOne
+      gs''2 ( ^ \markup \italic { dolce e molto ligato }
+      fs''4
+      e''4
+      |
+      ds''2
+      cs''2 )
+      |
+      ds''2 (
+      e''4
+      fs''4
+      |
+      <gs'' e''>2
+      <fs'' ds''>2 )
+      |
+      \oneVoice
+      \clef bass
+      <gs' e' b>2 (
+      <fs' ds' a>4
+      <e' cs' gs>4
+      |
+      <ds' bs fs>2
+      <cs' a e>2 )
+      |
+      \voiceOne
+      b2 %(
+      cs'4
+      ds'4
+      |
+      \clef treble
+      <e' gs>4 %)
+      r4 r2
+    }
+
+    % RH Voice 2
+    \new Voice {
+      \voiceTwo
+      \override Staff.DynamicLineSpanner.staff-padding = #3
+      <e'' b'>2 \p
+      <ds'' a'>4
+      <cs'' gs'>4
+      |
+      <bs' fs'>2
+      e'2
+      |
+      <b'! a'>2 -\tweak #'style #'none \cresc
+      b'4
+      <e'' cs''>4
+      |
+      b'2. ( \sf \>
+      a'4 )
+      \clef bass
+      | \break
+      s1 \p
+      |
+      s1
+      |
+      <gs e>4 (
+      <a fs>2. )
+      |
+      s4
+      r4 r2
+    }
+
+  >>
+
+  % LH Staff
+  \new Staff {
+    \override Staff.SustainPedalLineSpanner.staff-padding = #6
+    <gs' e'>2 ( \sustainOn
+    <fs' ds' b>4 \sustainOff
+    <e' cs'>4
+    |
+    <ds' bs gs>2
+    <cs' a>2 ) \sustainOn
+    |
+    \clef bass
+    \slurDown
+    <ds' b! a fs>2 ( \sustainOff
+    <e' b gs>4
+    <fs' cs' a>4 \sustainOn
+    |
+    \clef treble
+    \voiceOne
+    <<
+      {
+        <gs' e'>2
+        <fs' ds'>2 )
+      }
+      \new Voice {
+        \voiceTwo
+        b1 \sustainOff
+      }
+    >>
+    \oneVoice
+    |
+    %\break
+    \clef bass
+    <gs e>2 (
+    <fs ds b,>4
+    <e cs>4
+    |
+    <ds bs, gs,>2
+    <cs a,>2 ) \sustainOn
+    |
+    <b,! b,,!>1 ( \sustainOff
+    |
+    <e e,>4 )
+    r4 r2
+  }
+
+>>
diff --git a/Documentation/snippets/new/vertically-aligned-dynamics-and-textscripts.ly b/Documentation/snippets/new/vertically-aligned-dynamics-and-textscripts.ly
new file mode 100644 (file)
index 0000000..909f09e
--- /dev/null
@@ -0,0 +1,34 @@
+\version "2.17.27"
+
+\header {
+  lsrtags = "spacing, tweaks-and-overrides, workaround"
+
+  texidoc = "
+All @code{DynamicLineSpanner} objects (hairpins and dynamic texts) are
+placed with their reference line at least @code{'staff-padding} from
+the staff, unless other notation forces them to be farther.
+Setting @code{'staff-padding} to a sufficiently large value aligns the
+dynamics.
+
+The same idea, together with @code{\\textLengthOn}, is used to align
+the text scripts along their baseline.
+
+"
+  doctitle = "Vertically aligned dynamics and textscripts"
+}
+\markup \vspace #1 %avoid LSR-bug
+
+music = \relative c' {
+  a'2\p b\f
+  e4\p f\f\> g, b\p
+  c2^\markup { \huge gorgeous } c^\markup { \huge fantastic }
+}
+
+{
+  \music
+  \break
+  \override DynamicLineSpanner.staff-padding = #3
+  \textLengthOn
+  \override TextScript.staff-padding = #1
+  \music
+}
index 270c696b3f040583607c60af793302086f60c28c..ad09b5755ba21e09989d1516d5e0d04db8791213 100644 (file)
@@ -1,10 +1,11 @@
-%% DO NOT EDIT this file manually; it is automatically
-%% generated from LSR http://lsr.dsi.unimi.it
-%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
-%% and then run scripts/auxiliar/makelsr.py
-%%
-%% This file is in the public domain.
-\version "2.17.25"
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation/snippets/new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.17.27
+\version "2.17.27"
 
 \header {
   lsrtags = "headword"
@@ -67,7 +68,7 @@ Piches headword
     % RH Voice 2
     \new Voice {
       \voiceTwo
-      \override Staff.DynamicLineSpanner.staff-padding = #2.5
+      \override Staff.DynamicLineSpanner.staff-padding = #3
       <e'' b'>2 \p
       <ds'' a'>4
       <cs'' gs'>4
@@ -75,8 +76,7 @@ Piches headword
       <bs' fs'>2
       e'2
       |
-      \once \override TextScript.staff-padding = #2.5
-      <b'! a'>2 _ \markup \italic { cresc. }
+      <b'! a'>2 -\tweak #'style #'none \cresc
       b'4
       <e'' cs''>4
       |
@@ -99,7 +99,7 @@ Piches headword
 
   % LH Staff
   \new Staff {
-    \override Staff.SustainPedalLineSpanner.staff-padding = #5
+    \override Staff.SustainPedalLineSpanner.staff-padding = #6
     <gs' e'>2 ( \sustainOn
     <fs' ds' b>4 \sustainOff
     <e' cs'>4
index 494a2c9b0ce687be8d2cb2c3b3b2678a9e0c9b27..82a609c12ff66ab2af1f3ff5dab4e56d575198fb 100644 (file)
@@ -1,20 +1,21 @@
-%% DO NOT EDIT this file manually; it is automatically
-%% generated from LSR http://lsr.dsi.unimi.it
-%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
-%% and then run scripts/auxiliar/makelsr.py
-%%
-%% This file is in the public domain.
-\version "2.17.25"
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation/snippets/new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.17.27
+\version "2.17.27"
 
 \header {
   lsrtags = "spacing, tweaks-and-overrides, workaround"
 
   texidoc = "
-By setting the @code{'Y-extent} property to a suitable value, all
-@code{DynamicLineSpanner} objects (hairpins and dynamic texts) can be
-aligned to a common reference point, regardless of their actual extent.
-This way, every element will be vertically aligned, thus producing a
-more pleasing output.
+All @code{DynamicLineSpanner} objects (hairpins and dynamic texts) are
+placed with their reference line at least @code{'staff-padding} from
+the staff, unless other notation forces them to be farther.
+Setting @code{'staff-padding} to a sufficiently large value aligns the
+dynamics.
 
 The same idea, together with @code{\\textLengthOn}, is used to align
 the text scripts along their baseline.
@@ -34,9 +35,8 @@ music = \relative c' {
 {
   \music
   \break
-  \override DynamicLineSpanner.staff-padding = #2.0
-  \override DynamicLineSpanner.Y-extent = #'(-1.5 . 1.5)
+  \override DynamicLineSpanner.staff-padding = #3
   \textLengthOn
-  \override TextScript.Y-extent = #'(-1.5 . 1.5)
+  \override TextScript.staff-padding = #1
   \music
 }