-
-
-/*
- Get the measure wide ant for arithmetic spacing.
-*/
-Real
-Spacing_spanner::get_duration_space (Grob *me,
- Moment d,
- Rational shortest, bool *expand_only)
-{
- Real k = robust_scm2double (me->get_property ("shortest-duration-space"), 1);
- Real incr = robust_scm2double (me->get_property ("spacing-increment"), 1);
-
- if (d < shortest)
- {
- /*
- We don't space really short notes using the log of the
- duration, since it would disproportionally stretches the long
- notes in a piece. In stead, we use geometric spacing with constant 0.5
- (i.e. linear.)
-
- This should probably be tunable, to use other base numbers.
-
- In Mozart hrn3 by EB., we have 8th note = 3.9 mm (total), 16th note =
- 3.6 mm (total). head-width = 2.4, so we 1.2mm for 16th, 1.5
- mm for 8th. (white space), suggesting that we use
-
- (1.2 / 1.5)^{-log2(duration ratio)}
-
-
- */
- Rational ratio = d.main_part_ / shortest;
-
- return ((k - 1) + double (ratio)) * incr;
- }
- else
- {
- /*
- John S. Gourlay. ``Spacing a Line of Music, '' Technical
- Report OSU-CISRC-10/87-TR35, Department of Computer and
- Information Science, The Ohio State University, 1987.
- */
- Real log = log_2 (shortest);
- k -= log;
- Rational compdur = d.main_part_ + d.grace_part_ / Rational (3);
- *expand_only = false;
-
- return (log_2 (compdur) + k) * incr;
- }
-}
-
-