From a2030063498b24f5b08e10b0e429a12a82abbf2d Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Wed, 4 Sep 2013 23:51:03 -0700 Subject: [PATCH] Doc: update staff-padding --- Documentation/learning/tweaks.itely | 20 +- Documentation/notation/keyboards.itely | 2 +- Documentation/notation/spacing.itely | 6 +- .../snippets/broken-crescendo-hairpin.ly | 47 ++- Documentation/snippets/expressive-headword.ly | 17 +- .../snippets/new/broken-crescendo-hairpin.ly | 42 +++ .../snippets/new/expressive-headword.ly | 268 ++++++++++++++++++ .../snippets/new/pitches-headword.ly | 137 +++++++++ ...ically-aligned-dynamics-and-textscripts.ly | 34 +++ Documentation/snippets/pitches-headword.ly | 22 +- ...ically-aligned-dynamics-and-textscripts.ly | 30 +- 11 files changed, 546 insertions(+), 79 deletions(-) create mode 100644 Documentation/snippets/new/broken-crescendo-hairpin.ly create mode 100644 Documentation/snippets/new/expressive-headword.ly create mode 100644 Documentation/snippets/new/pitches-headword.ly create mode 100644 Documentation/snippets/new/vertically-aligned-dynamics-and-textscripts.ly diff --git a/Documentation/learning/tweaks.itely b/Documentation/learning/tweaks.itely index fdb9008721..5802044e42 100644 --- a/Documentation/learning/tweaks.itely +++ b/Documentation/learning/tweaks.itely @@ -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 diff --git a/Documentation/notation/keyboards.itely b/Documentation/notation/keyboards.itely index 1bb79b7c5a..a8405b5274 100644 --- a/Documentation/notation/keyboards.itely +++ b/Documentation/notation/keyboards.itely @@ -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\! } diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index c85be83869..2b3299d741 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -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 } diff --git a/Documentation/snippets/broken-crescendo-hairpin.ly b/Documentation/snippets/broken-crescendo-hairpin.ly index 66e8382992..68960a5840 100644 --- a/Documentation/snippets/broken-crescendo-hairpin.ly +++ b/Documentation/snippets/broken-crescendo-hairpin.ly @@ -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" @@ -12,16 +13,12 @@ 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 } >> diff --git a/Documentation/snippets/expressive-headword.ly b/Documentation/snippets/expressive-headword.ly index 8183a4e050..b7caf83f1e 100644 --- a/Documentation/snippets/expressive-headword.ly +++ b/Documentation/snippets/expressive-headword.ly @@ -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 index 0000000000..27df9446ad --- /dev/null +++ b/Documentation/snippets/new/broken-crescendo-hairpin.ly @@ -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 index 0000000000..1f9cf0f33c --- /dev/null +++ b/Documentation/snippets/new/expressive-headword.ly @@ -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 + } + >> + + | + + 4 \tenuto + d'8 \staccato + g'8 \staccato + b'8 \staccato + d''8 \staccato + + | + + d''8 ( + 8 \staccato ) + 8 \staccato + d''8 ( + 8 \staccato ) + 8 \staccato + + | + + d''8 ( + 8 \staccato ) + 8 \staccato + d''8 ( + 8 \staccato ) + 8 \staccato + + | + + d''8 \staccato + 8 \staccato + 8 \staccato + d'' \staccato + 8 \staccato + 8 \staccato + + | + + 4 \fermata + r8 r4 r8 + } + + % LH Staff + \new Staff { + \clef bass + \key g \major + \time 6/8 + \partial 2 + r8 + r8 + 8 \staccato + 8 \staccato + + | + + 4 + r8 + r8 + 8 \staccato + 8 \staccato + + | + + 4 + r8 + r8 + 8 \staccato + 8 \staccato + + | + + 8 \staccato + 8 \staccato + 8 \staccato + 4. ( + + | + + d'4 ) + r8 + r8 + 8 \staccato + 8 \staccato + + | + + 4 + r8 + r8 + 8 \staccato + 8 \staccato + + | + + 4 + r8 + r8 + 8 \staccato + 8 \staccato + + | + + 8 \staccato + 8 \staccato + 8 \staccato + 4 + 8 \staccato + + | + + 4 \tenuto + r8 + r4 + r8 + + | + + r8 + 8 \staccato + 8 \staccato + r8 + 8 \staccato + 8 \staccato + + | + + r8 + 8 \staccato + 8 \staccato + r8 + 8 \staccato + 8 \staccato + + | + + r8 + 8 \staccato + 8 \staccato + r8 + 8 \staccato + 8 \staccato + + | + + 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 index 0000000000..70246ce579 --- /dev/null +++ b/Documentation/snippets/new/pitches-headword.ly @@ -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 + | + 2 + 2 ) + | + \oneVoice + \clef bass + 2 ( + 4 + 4 + | + 2 + 2 ) + | + \voiceOne + b2 %( + cs'4 + ds'4 + | + \clef treble + 4 %) + r4 r2 + } + + % RH Voice 2 + \new Voice { + \voiceTwo + \override Staff.DynamicLineSpanner.staff-padding = #3 + 2 \p + 4 + 4 + | + 2 + e'2 + | + 2 -\tweak #'style #'none \cresc + b'4 + 4 + | + b'2. ( \sf \> + a'4 ) + \clef bass + | \break + s1 \p + | + s1 + | + 4 ( + 2. ) + | + s4 + r4 r2 + } + + >> + + % LH Staff + \new Staff { + \override Staff.SustainPedalLineSpanner.staff-padding = #6 + 2 ( \sustainOn + 4 \sustainOff + 4 + | + 2 + 2 ) \sustainOn + | + \clef bass + \slurDown + 2 ( \sustainOff + 4 + 4 \sustainOn + | + \clef treble + \voiceOne + << + { + 2 + 2 ) + } + \new Voice { + \voiceTwo + b1 \sustainOff + } + >> + \oneVoice + | + %\break + \clef bass + 2 ( + 4 + 4 + | + 2 + 2 ) \sustainOn + | + 1 ( \sustainOff + | + 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 index 0000000000..909f09e62d --- /dev/null +++ b/Documentation/snippets/new/vertically-aligned-dynamics-and-textscripts.ly @@ -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 +} diff --git a/Documentation/snippets/pitches-headword.ly b/Documentation/snippets/pitches-headword.ly index 270c696b3f..ad09b5755b 100644 --- a/Documentation/snippets/pitches-headword.ly +++ b/Documentation/snippets/pitches-headword.ly @@ -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 2 \p 4 4 @@ -75,8 +76,7 @@ Piches headword 2 e'2 | - \once \override TextScript.staff-padding = #2.5 - 2 _ \markup \italic { cresc. } + 2 -\tweak #'style #'none \cresc b'4 4 | @@ -99,7 +99,7 @@ Piches headword % LH Staff \new Staff { - \override Staff.SustainPedalLineSpanner.staff-padding = #5 + \override Staff.SustainPedalLineSpanner.staff-padding = #6 2 ( \sustainOn 4 \sustainOff 4 diff --git a/Documentation/snippets/vertically-aligned-dynamics-and-textscripts.ly b/Documentation/snippets/vertically-aligned-dynamics-and-textscripts.ly index 494a2c9b0c..82a609c12f 100644 --- a/Documentation/snippets/vertically-aligned-dynamics-and-textscripts.ly +++ b/Documentation/snippets/vertically-aligned-dynamics-and-textscripts.ly @@ -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 } -- 2.39.5