]> git.donarmstrong.com Git - lilypond.git/commitdiff
Tempo and Rehearsal marks horizontal positioning; issue 3279
authorKeith OHara <k-ohara5a5a@oco.net>
Thu, 28 Mar 2013 07:13:57 +0000 (00:13 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Fri, 26 Apr 2013 04:27:50 +0000 (21:27 -0700)
Space tempo/rehearsal marks so they do not overlap each other.
Do not use side-position interface for their initial vertical position,
because they are moved to the top-most staff after line-breaking.

Documentation/changes.tely
Documentation/learning/tweaks.itely
Documentation/notation/rhythms.itely
Documentation/notation/text.itely
input/regression/metronome-marking.ly
ly/engraver-init.ly
ly/property-init.ly
scm/define-grobs.scm
scm/output-lib.scm

index 951dabd22bf86dbba406bf8e05e3fe5f7c6d9f19..313f3845beefdd85ed45790799059e3130f810d8 100644 (file)
@@ -61,6 +61,17 @@ which scares away people.
 
 @end ignore
 
+@item
+Horizontal space is allowed for tempo and rehearsal marks,
+so that these marks do not overlap each other.
+A new command @code{\markLengthOff} turns this feature off.
+@lilypond[quote,relative=0]
+\compressFullBarRests
+\tempo "Molto vivace" c''2 c'
+\mark\default
+\tempo "Meno mosso" R1*16
+@end lilypond
+
 @item
 When @code{\relative} is used without an explicit reference pitch,
 the reference pitch now is the middle of the first octave, making
index 9dc53ff8f9dcb331097b863e1877764423c23a14..5e8365a90893d1f057b85021bea7edc0c5a65d53 100644 (file)
@@ -2285,6 +2285,9 @@ The command to revert to the default behavior is
 @code{\textLengthOff}.  Alternatively, @code{\once} may be used
 with @code{\textLengthOn} if the effect is to be limited to just a
 single musical moment.
+The corresponding spacing behavior for rehearsal marks and tempo
+indications is independently controlled with the commands
+@code{\markLengthOn} and @code{\markLengthOff}.
 
 @cindex markup text, allowing collisions
 
index 08d9b7ca13c5c61d9ab56711a1a5f23e3a8e32f0..9250fd1968600eaf66e5edb86d121091ceba0771 100644 (file)
@@ -1333,6 +1333,24 @@ written by including an empty string in the input:
 d4 g e c
 @end lilypond
 
+@funindex \markLengthOn
+@funindex markLengthOn
+@funindex \markLengthOff
+@funindex markLengthOff
+
+When tempo indications follow each other closely in the music,
+such as in a part for an instrument with long periods of rests,
+the measures are stretched horizontally so that the tempo indications
+do not overlap.  The commands @code{\markLengthOn} and
+@code{\markLengthOff} control this behavior.
+
+@lilypond[quote,relative=0]
+\compressFullBarRests
+\tempo "Molto vivace"
+R1*12
+\tempo "Meno mosso"
+R1*16
+@end lilypond
 
 @snippets
 
index e6a085fc56e0b6488be5580168fdd8fafb5e6104..82c7a209a3476f2a6f1f5535d172fb835f7fc595 100644 (file)
@@ -268,6 +268,15 @@ c1 c
 c  c
 @end lilypond
 
+@funindex \markLengthOn
+@funindex markLengthOn
+@funindex \markLengthOff
+@funindex markLengthOff
+
+@predefined
+@code{\markLengthOn},
+@code{\markLengthOff}.
+@endpredefined
 
 @snippets
 
index e987176b7e1a08a269b188d2e7975e977ec8e977..ac115273c3fc834d1f0554f1745a74264be90431 100644 (file)
@@ -14,10 +14,10 @@ The marking is left aligned with the time signature, if there is one.
 
 \layout {  ragged-right = ##t }
 
-\version "2.16.0"
+\version "2.17.17"
 
 \relative c'' {
-  \tempo \breve = 100 c1 c1 \tempo 8.. = 50 c1
+  \tempo \breve = 100 c1 c1 \tempo "Allegro" 8.. = 50 c1 \tempo "Adagio" c2 c'
 }
 
 
index 5902b25da9833d050b29a8287f5abb4d44d16ab7..d6036bc4efcd06aa0bed5a2275632bbfbd9e069c 100644 (file)
@@ -90,6 +90,7 @@
   localKeySignature = #'()
   createSpacing = ##t
   ignoreFiguredBassRest = ##f
+  \markLengthOff
 
   %% explicitly set instrument, so we don't get
   %% weird effects when doing instrument names for
@@ -172,6 +173,7 @@ contained staves are not connected vertically."
   \override BarLine.bar-extent = #'(-2 . 2)
   \override VoltaBracket.staff-padding = #3
   \override StaffSymbol.line-count = #1
+  \markLengthOff
 
   \override Stem.neutral-direction = #UP
   \override Beam.neutral-direction = #UP
@@ -704,6 +706,7 @@ automatically when an output definition (a @code{\\score} or
 %%
   figuredBassFormatter = #format-bass-figure
   metronomeMarkFormatter = #format-metronome-markup
+  \markLengthOn
 
 
   %% See also make-voice-props-set
index 633a12909ad1a0a42ccc6508b67e5118058605f7..fc7c67179a377b7e05d2e664539df5b6f97425e0 100644 (file)
@@ -564,6 +564,15 @@ textLengthOff = {
   \revert TextScript.outside-staff-horizontal-padding
 }
 
+markLengthOn = {
+  \override Score.MetronomeMark.extra-spacing-width = #'(-0.5 . 0.5)
+  \override Score.RehearsalMark.extra-spacing-width = #'(-0.5 . 0.5)
+}
+
+markLengthOff = {
+  \override Score.MetronomeMark.extra-spacing-width = #'(+inf.0 . -inf.0)
+  \override Score.RehearsalMark.extra-spacing-width = #'(+inf.0 . -inf.0)
+}
 
 %% text spanners
 
index 81e4377ff43b9959f553a8a21c76fa86970930f1..1b834a2e2d28c8fb007b1b3d7ed7ea3056551285 100644 (file)
        (after-line-breaking . ,ly:side-position-interface::move-to-extremal-staff)
        (break-visibility . ,end-of-line-invisible)
        (direction . ,UP)
-       (extra-spacing-width . (+inf.0 . -inf.0))
        (outside-staff-horizontal-padding . 0.12)
        (outside-staff-priority . 1000)
-       (padding . 0.8)
+       (outside-staff-padding . 0.5)
        (side-axis . ,Y)
        (skyline-horizontal-padding . 0.2)
        (stencil . ,ly:text-interface::print)
        (vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
-       (Y-offset . ,side-position-interface::y-aligned-side)
+       (Y-offset . ,(ly:make-unpure-pure-container
+                       side-position-interface::y-aligned-side
+                       outside-staff::pure-Y-offset))
        (X-offset . ,(ly:make-simple-closure
                      `(,+
                        ,(ly:make-simple-closure
        (break-align-symbols . (staff-bar key-signature clef))
        (break-visibility . ,end-of-line-invisible)
        (direction . ,UP)
-       (extra-spacing-width . (+inf.0 . -inf.0))
        (font-size . 2)
        (non-musical . #t)
        (outside-staff-horizontal-padding . 0.12)
        (outside-staff-priority . 1500)
-       (padding . 0.8)
+       (outside-staff-padding . 0.5)
        (self-alignment-X . ,CENTER)
        (stencil . ,ly:text-interface::print)
        (vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
                          (list ly:break-alignable-interface::self-align-callback))
                        ,(ly:make-simple-closure
                          (list ly:self-alignment-interface::x-aligned-on-self)))))
-       (Y-offset . ,side-position-interface::y-aligned-side)
+       (Y-offset . ,(ly:make-unpure-pure-container
+                       side-position-interface::y-aligned-side
+                       outside-staff::pure-Y-offset))
        (Y-extent . ,grob::always-Y-extent-from-stencil)
        (meta . ((class . Item)
                 (interfaces . (break-alignable-interface
index 3348ca470df0011e8140ad15b5575254994f136a..caa7032c70b9a5879f3a4adb05f899d1b3196b9a 100644 (file)
@@ -854,6 +854,14 @@ and duration-log @var{log}."
    the previous calculated offset value."
   prev-offset)
 
+(define-public (outside-staff::pure-Y-offset grob start end)
+  "Initial vertical placement of items such as tempo and
+   rehearsal marks, for use in note-spacing."
+   (* (+ (ly:staff-symbol-staff-radius grob)
+         (ly:grob-property grob 'outside-staff-padding 0.0)
+         1.0)
+      (ly:grob-property grob 'direction CENTER)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;