Hi,
On Wed, Feb 4, 2015 at 8:44 AM, Werner LEMBERG <[email protected]> wrote:
>
> > Why not make it possible to give different values of minimum-length
> > right when you do the basic override? Perhaps minimum-length could
> > be a pair, one number giving the non-broken value, another giving
> > the broken. Or--less intrusive--there could be a property alongside
> > it which acted on a broken object, I think that would be pretty easy
> > to implement.
>
> In case it is easy to implement a `minimum-length-broken' property,
> please proceed! It would magically improve *a lot* of scores, I
> guess.
>
If it's convenient, have a look at the attached patch/sketch. It adds a
property, minimum-length-left-broken, which lets you adjust broken bits
that start a line. (Unfortunately I have to send this as a patch, as it
modifies C++ code...)
The example file shows how minimum-length and the new property interact
with each other.
> From a philosophical point, however, such a fix basically goes into
> the wrong direction. IMHO, `minimum-length' should do what its name
> advertises, namely controlling the length of the tie, and not the
> distance between its associated note heads. The current
> implementation is completely unpredictable in tight typesetting
> situations if there are accidentals and/or chords.
>
>
Yes, I see what you mean. Absolutely it should be the actual length of the
tie that is measured. From the discussion on Issue 14, I see that looking
at distances between notes was the convenient route to go, and that
handling the actual lengths of ties is tricky given the "topography" of
chords.
I don't have a solution to this oldest-of-all open issues.
Hopefully, though, this will prove useful. Perhaps even when 14 is fixed
it will be useful to have different settings for broken pieces, so I'm not
so sure that this patch is interfering.
--David
From 66e797dc7421f9b142b8186cacfd499490d97b1f Mon Sep 17 00:00:00 2001
From: David Nalesnik <[email protected]>
Date: Wed, 4 Feb 2015 14:07:01 -0600
Subject: [PATCH] Allow independent adjustment of minimum length for spanner siblings
The property minimum-length affects both unbroken and broken spanners, making
independent adjustment impossible. This patch adds a property,
minimum-length-left-broken, which, if set, behaves similarly to minimum-length,
but only affects siblings starting a line. If unset, minimum-length still controls
all lengths.
---
lily/spanner.cc | 7 ++++++-
scm/define-grob-properties.scm | 2 ++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/lily/spanner.cc b/lily/spanner.cc
index 66b35dc..bfb09aa 100644
--- a/lily/spanner.cc
+++ b/lily/spanner.cc
@@ -366,7 +366,9 @@ Spanner::set_spacing_rods (SCM smob)
{
Grob *me = Grob::unsmob (smob);
SCM num_length = me->get_property ("minimum-length");
- if (scm_is_number (num_length))
+ SCM left_broken_length = me->get_property ("minimum-length-left-broken");
+ if (scm_is_number (num_length)
+ || scm_is_number (left_broken_length))
{
Rod r;
Spanner *sp = dynamic_cast<Spanner *> (me);
@@ -389,6 +391,8 @@ Spanner::set_spacing_rods (SCM smob)
r.item_drul_[LEFT] = cols.back ()->find_prebroken_piece (RIGHT);
r.item_drul_[RIGHT] = sp->get_bound (RIGHT);
+ if (scm_is_number (left_broken_length))
+ r.distance_ = robust_scm2double (left_broken_length, 0);
r.add_to_cols ();
}
@@ -546,6 +550,7 @@ ADD_INTERFACE (Spanner,
/* properties */
"normalized-endpoints "
"minimum-length "
+ "minimum-length-left-broken "
"spanner-broken "
"spanner-id "
"to-barline "
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index 0d5eaa1..8ea7203 100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -637,6 +637,8 @@ this long, normally in the horizontal direction. This requires an
appropriate callback for the @code{springs-and-rods} property. If
added to a @code{Tie}, this sets the minimum distance between
noteheads.")
+ (minimum-length-left-broken ,ly:dimension? "If set, try to make a
+a left-broken spanner this long.")
(minimum-length-fraction ,number? "Minimum length of ledger line
as fraction of note head size.")
(minimum-space ,ly:dimension? "Minimum distance that the victim
--
1.7.0.4
\version "2.19.16"
\paper {
indent = 0
ragged-right = ##t
}
% default
{
cis''1 ~ \break
cis''1
}
% all influenced by minimum-length
{
\override Tie.minimum-length = 10
cis''1 ~ \break
cis''1
}
% only left-broken piece affected
{
\override Tie.minimum-length-left-broken = 10
cis''1 ~ \break
cis''1
}
% different settings for left-broken and all else
{
\override Tie.minimum-length = 10
\override Tie.minimum-length-left-broken = 0
cis''1 ~ \break
cis''1
}
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user