From: David Kastrup Date: Mon, 17 Feb 2014 15:37:07 +0000 (+0100) Subject: Revert "spacing-options: clarify documentation" X-Git-Tag: release/2.18.2-1~14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=57426b4a7afc223908d04a44dd900538504a4570;p=lilypond.git Revert "spacing-options: clarify documentation" This reverts commit 93b7d2447f2844428c8f1c727f724431d56aead9. --- diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index 3361880434..7f3a50f1f3 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -2768,7 +2768,8 @@ more space, shorter durations get less. The shortest durations get a fixed amount of space (which is controlled by @code{shortest-duration-space} in the @rinternals{SpacingSpanner} object). The longer the duration, the more space it gets: doubling a -duration adds @code{spacing-increment} of space to the note. +duration adds a fixed amount (this amount is controlled by +@code{spacing-increment}) of space to the note. For example, the following piece contains lots of half, quarter, and 8th notes; the eighth note is followed by 1 note head width (NHW). diff --git a/lily/spacing-options.cc b/lily/spacing-options.cc index 7641581c35..e90dcebcab 100644 --- a/lily/spacing-options.cc +++ b/lily/spacing-options.cc @@ -66,9 +66,9 @@ Spacing_options::Spacing_options () Real Spacing_options::get_duration_space (Rational d) const { - Real ratio = d / global_shortest_; + Real k = shortest_duration_space_; - if (ratio < 1.0) + if (d < global_shortest_) { /* We don't space really short notes using the log of the @@ -86,8 +86,9 @@ Spacing_options::get_duration_space (Rational d) const */ + Rational ratio = d / global_shortest_; - return (shortest_duration_space_ + ratio - 1) * increment_; + return ((k - 1) + double (ratio)) * increment_; } else { @@ -96,8 +97,10 @@ Spacing_options::get_duration_space (Rational d) const Report OSU-CISRC-10/87-TR35, Department of Computer and Information Science, The Ohio State University, 1987. */ + Real log = log_2 (global_shortest_); + k -= log; - return (shortest_duration_space_ + log_2 (ratio)) * increment_; + return (log_2 (d) + k) * increment_; } } diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index d8043a60f8..6f3a7704ef 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -795,8 +795,9 @@ ending at that staff-position.") (shorten-pair ,number-pair? "The lengths to shorten a text-spanner on both sides, for example a pedal bracket. Positive values shorten the text-spanner, while negative values lengthen it.") - (shortest-duration-space ,number? "Start with this multiple of -@code{spacing-increment} space for the shortest duration. See also + (shortest-duration-space ,ly:dimension? "Start with this much +space for the shortest duration. This is expressed in +@code{spacing-increment} as unit. See also @rinternals{spacing-spanner-interface}.") (shortest-playing-duration ,ly:moment? "The duration of the shortest note playing here.") @@ -841,8 +842,8 @@ instead of to the beginning of the non-musical column. If there is a clef change followed by a bar line, for example, this means that we will try to space the non-musical column as though the clef is not there.") - (spacing-increment ,ly:dimension? "The unit of length for -note-spacing. Typically, the width of a note head. See also + (spacing-increment ,number? "Add this much space for a doubled +duration. Typically, the width of a note head. See also @rinternals{spacing-spanner-interface}.") (spacing-pair ,pair? "A pair of alignment symbols which set an object's spacing relative to its left and right @code{BreakAlignment}s. @@ -978,8 +979,8 @@ possible.") ;;; u ;;; (uniform-stretching ,boolean? "If set, items stretch -proportionally to their natural separation based on durations. -This looks better in complex polyphonic patterns.") +proportionally to their durations. This looks better in complex +polyphonic patterns.") (used ,boolean? "If set, this spacing column is kept in the spacing problem.") (usable-duration-logs ,list? "List of @code{duration-log}s that