From 4dfd074259db917085bea62d9edaae6ca1a7fd07 Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Wed, 26 Nov 2014 21:23:06 -0800 Subject: [PATCH] multi-measure-rest: space according to the full duration --- Documentation/changes.tely | 9 +++++++++ lily/multi-measure-rest.cc | 5 ++++- scm/define-grob-properties.scm | 3 +++ scm/define-grobs.scm | 3 ++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Documentation/changes.tely b/Documentation/changes.tely index 467f5a30ca..a90f386485 100644 --- a/Documentation/changes.tely +++ b/Documentation/changes.tely @@ -61,6 +61,15 @@ which scares away people. @end ignore +@item +Multi-measure rests have length according to their total duration, +under the control of @code{MultiMeasureRest.space-increment}. +@lilypond[quote] +{ \compressFullBarRests + \override MultiMeasureRest.space-increment = 2.2 + R1 R1 R1*2 R1*8 R1*24 R1*80 } +@end lilypond + @item Page numbers may now be printed in roman numerals, by setting the @code{page-number-type} paper variable. diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index a4990332f3..b6d95b8cf7 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -365,7 +365,9 @@ Multi_measure_rest::calculate_spacing_rods (Grob *me, Real length) Moment mlen = robust_scm2moment (li->get_property ("measure-length"), Moment (1)); length += robust_scm2double (li->get_property ("full-measure-extra-space"), 0.0) - + options.get_duration_space (mlen.main_part_); + + options.get_duration_space (mlen.main_part_) + + (robust_scm2double (me->get_property ("space-increment"), 0.0) + * log_2 (robust_scm2int (me->get_property ("measure-count"), 1))); } length += 2 * robust_scm2double (me->get_property ("bound-padding"), 0.0); @@ -434,6 +436,7 @@ ADD_INTERFACE (Multi_measure_rest, "minimum-length " "round-up-exceptions " "round-up-to-longer-rest " + "space-increment " "spacing-pair " "thick-thickness " "usable-duration-logs " diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index f3b684754f..676432bb1a 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -1284,6 +1284,9 @@ relevant for finding the @code{pure-Y-extent}.") grobs.") (slur ,ly:grob? "A pointer to a @code{Slur} object.") (spacing ,ly:grob? "The spacing spanner governing this section.") + (space-increment ,ly:dimension? "The amount by which the total duration +of a multimeasure rest affects horizontal spacing. Each doubling of the +duration adds @code{space-increment} to the length of the bar.") (spacing-wishes ,ly:grob-array? "An array of note spacing or staff spacing objects.") (span-start ,boolean? "Is the note head at the start of a spanner?") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 7ec30570dd..d90cc885a2 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1505,6 +1505,7 @@ (hair-thickness . 2.0) (round-up-exceptions . ()) (bound-padding . 0.5) + (space-increment . 2.0) (spacing-pair . (break-alignment . break-alignment)) (springs-and-rods . ,ly:multi-measure-rest::set-spacing-rods) (stencil . ,ly:multi-measure-rest::print) @@ -1523,7 +1524,7 @@ (MultiMeasureRestNumber . ( - (bound-padding . 2.0) + (bound-padding . 1.0) (direction . ,UP) (font-encoding . fetaText) (padding . 0.4) -- 2.39.2