]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix note spacing with melismata
authorKeith OHara <k-ohara5a5a@oco.net>
Fri, 21 Jan 2011 03:07:24 +0000 (19:07 -0800)
committerGraham Percival <graham@percival-music.ca>
Sat, 5 Feb 2011 00:23:23 +0000 (00:23 +0000)
Recede the extra-spacing-height of LyricText and similar items.
Create property skyline-vertical-padding for vertical padding of
left- and right-skylines used in note spacing.

input/regression/lyrics-melisma-beam.ly
lily/separation-item.cc
scm/define-grob-properties.scm
scm/define-grobs.scm

index 008bb69e7b216593cc54799477aa71319fea53e7..811acc80cae0ef82454e3a1898312092e3f39890 100644 (file)
@@ -1,7 +1,8 @@
 \version "2.12.0"
 \header
 {
-  texidoc = "Melismata are triggered by manual beams." 
+  texidoc = "Melismata are triggered by manual beams.  Notes in a
+  melisma take their natural spacing over a long syllable."
 }
 
   \layout { ragged-right = ##t }
@@ -13,9 +14,9 @@
   \new Staff
   \relative c'' {
     \set Staff.autoBeaming = ##f
-    c8 c8[ c8 c8]  c8    }
-  
-  \lyricsto "" \new Lyrics \lyricmode { bla bla bla }
+    g4 d8[ b8 d8 g8]  g4
+  }
+  \lyricsto "" \new Lyrics \lyricmode { bla blaa -- bla }
 >>
 
 
index 5df19544eb520efde47b5bec60bd753b844c93ec..013e457034bea442ae397211d431178888f0357c 100644 (file)
@@ -80,7 +80,8 @@ Skyline
 Separation_item::conditional_skyline (Grob *me, Grob *left)
 {
   vector<Box> bs = boxes (me, left);
-  return Skyline (bs, 0.0, Y_AXIS, LEFT);
+  Real horizon_padding = robust_scm2double (me->get_property ("skyline-vertical-padding"), 0.0);
+  return Skyline (bs, horizon_padding, Y_AXIS, LEFT);
 }
 
 
@@ -90,8 +91,8 @@ Separation_item::calc_skylines (SCM smob)
 {
   Item *me = unsmob_item (smob);
   vector<Box> bs = boxes (me, 0);
-  /* todo: the horizon_padding is somewhat arbitrary */
-  return Skyline_pair (bs, 0.0, Y_AXIS).smobbed_copy ();
+  Real horizon_padding = robust_scm2double (me->get_property ("skyline-vertical-padding"), 0.0);
+  return Skyline_pair (bs, horizon_padding, Y_AXIS).smobbed_copy ();
 }
 
 /* if left is non-NULL, get the boxes corresponding to the
@@ -189,4 +190,5 @@ ADD_INTERFACE (Separation_item,
               "elements "
               "padding "
               "horizontal-skylines "
+              "skyline-vertical-padding "
               );
index 9f36ecb89b55d8104b3dfe4e82b55f74b321f2f7..e92bf9ce345a908bec29d023681330e0ef446b2f 100644 (file)
@@ -721,6 +721,11 @@ vertical distance between two staves, it is possible to have a
 configuration which would result in a tight interleaving of grobs from
 the top staff and the bottom staff.  The larger this parameter is, the
 farther apart the staves are placed in such a configuration.")
+     (skyline-vertical-padding ,number? "The amount by which the left
+and right skylines of a column are padded vertically, beyond the
+@code{Y-extent}s and @code{extra-spacing-height}s of the constituent
+grobs in the column.  Increase this to prevent interleaving of grobs
+from adjacent columns.")
      (slash-negative-kern ,number? "The space to remove between
 slashes in percent repeat glyphs.  Larger values bring the two
 elements closer together.")
index 14e7212a0b4a692f73710e7bfdf4414d016d31c7..59f756e8a0ccb709b0db7f39230f5a9d4c1550a0 100644 (file)
        (font-family . sans)
        (font-size . 1.5)
        (stencil . ,ly:text-interface::print)
+       (extra-spacing-height . (0.2 . -0.2))
        (word-space . 0.0)
        (meta . ((class . Item)
                 (interfaces . (chord-name-interface
                        (next-note . (extra-space . 0.5))
                        (right-edge . (extra-space . 0.5))))
        (stencil . ,ly:clef::print)
-       (extra-spacing-height . (-0.5 . 0.5))
        (Y-offset . ,ly:staff-symbol-referencer::callback)
        (meta . ((class . Item)
                 (interfaces . (break-aligned-interface
                        (next-note . (extra-space . 0.5))
                        (right-edge . (extra-space . 0.5))))
        (stencil . ,ly:clef::print)
-       (extra-spacing-height . (-0.5 . 0.5))
        (Y-offset . ,ly:staff-symbol-referencer::callback)
        (meta . ((class . Item)
                 (interfaces . (break-aligned-interface
                        (next-note . (extra-space . 0.5))
                        (right-edge . (extra-space . 0.5))))
        (stencil . ,ly:clef::print)
-       (extra-spacing-height . (-0.5 . 0.5))
        (Y-offset . ,ly:staff-symbol-referencer::callback)
        (meta . ((class . Item)
                 (interfaces . (break-aligned-interface
        (after-line-breaking . ,ly:chord-name::after-line-breaking)
        (fret-diagram-details . ((finger-code . below-string)))
        (stencil . ,fret-board::calc-stencil)
+       (extra-spacing-height . (0.2 . -0.2))
        (meta . ((class . Item)
                 (interfaces . (chord-name-interface
                                font-interface
        (break-align-symbol . left-edge)
        (break-visibility . ,center-invisible)
        (non-musical . #t)
+       (extra-spacing-height . (+inf.0 . -inf.0))
        (space-alist . (
                        (ambitus . (extra-space . 2.0))
                        (breathing-sign . (minimum-space . 0.0))
     (LyricText
      . (
        (extra-spacing-width . (0.0 . 0.0))
+       ;; Recede in height for purposes of note spacing,
+       ;; so notes in melismata can be freely spaced above lyrics
+       (extra-spacing-height . (0.2 . -0.2))
        (font-series . medium)
        (font-size . 1.0)
        (self-alignment-X . ,CENTER)
        (before-line-breaking . ,ly:paper-column::before-line-breaking)
        (full-measure-extra-space . 1.0)
        (horizontal-skylines . ,ly:separation-item::calc-skylines)
+       (skyline-vertical-padding . 0.15)
        ;;                    (stencil . ,ly:paper-column::print)
 
        (line-break-permission . allow)
      . (
        (axes . (,X ,Y))
        (horizontal-skylines . ,ly:separation-item::calc-skylines)
+       (skyline-vertical-padding . 0.15)
        (X-extent . ,ly:axis-group-interface::width)
        (Y-extent . ,ly:axis-group-interface::height)
        (meta . ((class . Item)
        (duration-log . ,note-head::calc-duration-log)
        (extra-spacing-height . ,ly:note-head::include-ledger-line-height)
        (glyph-name . ,note-head::calc-glyph-name)
-        (ligature-flexa . #f)
+       (ligature-flexa . #f)
        (stem-attachment . ,ly:note-head::calc-stem-attachment)
        (stencil . ,ly:note-head::print)
        (X-offset . ,ly:note-head::stem-x-shift)