lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: change tie color


From: Thomas Morley
Subject: Re: change tie color
Date: Wed, 20 Sep 2017 21:54:01 +0200

2017-09-20 10:29 GMT+02:00 David Kastrup <address@hidden>:
> Gianmaria Lari <address@hidden> writes:
>
>> I'm sorry but I'm not able to make them working. In both cases I get
>>
>> unexpected post-event
>> c1
>>   \myGrey ~ c1
>
> c1-\myGrey ~
>
> should work: Harm (probably accidentally) relied on a 2.21.0 feature
> that's not much more than a week old and incidentally was triggered by a
> different complaint from you.
>
> Frankly, I consider the approach of letting the tie color callback look
> for the right bound of the tie and coloring it as a side effect
> distasteful.

Such a strong word lol

> There is no real guarantee that the latter's color will be
> consulted after the former's.

Indeed. I found quickly:

\fixed c'' {
  c1-\myGrey ~ \break c1
}

not working

> I think two coloring calls in the input should be a tolerable burden on
> the user and be much more transparent about what is happening.

Honestly, I was surprised it worked at all as a color callback.
Although I'd like to agree about two tweaks being tolerable; anything
against below?

#(define (set-tie-right-bound-color clr)
  (lambda (grob)
    (let* ((right-bound (ly:spanner-bound grob RIGHT))
           (right-is-note?
             (grob::has-interface right-bound 'note-head-interface)))
      (if right-is-note?
          (ly:grob-set-property! right-bound 'color clr))
      (ly:grob-set-property! grob 'color clr))))

greyed =
\tweak after-line-breaking #(set-tie-right-bound-color red) \etc

\fixed c'' {
  c1-\greyed ~ c1
  c1-\greyed ~ \break c1
  c1-\greyed ~ c1
}


Cheers,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]