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 a fixed amount (this amount is controlled by
-@code{spacing-increment}) of space to the note.
+duration adds @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).
Real
Spacing_options::get_duration_space (Rational d) const
{
- Real k = shortest_duration_space_;
+ Real ratio = d / global_shortest_;
- if (d < global_shortest_)
+ if (ratio < 1.0)
{
/*
We don't space really short notes using the log of the
*/
- Rational ratio = d / global_shortest_;
- return ((k - 1) + double (ratio)) * increment_;
+ return (shortest_duration_space_ + ratio - 1) * increment_;
}
else
{
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 (log_2 (d) + k) * increment_;
+ return (shortest_duration_space_ + log_2 (ratio)) * increment_;
}
}
(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 ,ly:dimension? "Start with this much
-space for the shortest duration. This is expressed in
-@code{spacing-increment} as unit. See also
+ (shortest-duration-space ,number? "Start with this multiple of
+@code{spacing-increment} space for the shortest duration. See also
@rinternals{spacing-spanner-interface}.")
(shortest-playing-duration ,ly:moment? "The duration of the
shortest note playing here.")
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 ,number? "Add this much space for a doubled
-duration. Typically, the width of a note head. See also
+ (spacing-increment ,ly:dimension? "The unit of length for
+note-spacing. 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.
;;; u
;;;
(uniform-stretching ,boolean? "If set, items stretch
-proportionally to their durations. This looks better in complex
-polyphonic patterns.")
+proportionally to their natural separation based on 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