lilypond-user
[Top][All Lists]
Advanced

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

Re: [Issue?] hiding Accidental(s) on tied note(s) after a line break


From: Joe Neeman
Subject: Re: [Issue?] hiding Accidental(s) on tied note(s) after a line break
Date: Sat, 30 May 2009 20:00:19 -0700
User-agent: KMail/1.11.2 (Linux/2.6.28-11-generic; KDE/4.2.2; i686; ; )

On Saturday 30 May 2009 07:41:51 pm Kieren MacMillan wrote:
> The saga continues...  =)
>
> I've hacked the Tie callback to try to adjust the Accidental
> property. Coloring the Accidental works fine:
>
> %%%%%%%%%%%%%
> \version "2.12.2"
>
> #(define (tie-callback tiegrob)
>    (let* (
>      ; have we been split?
>      (orig (ly:grob-original tiegrob))
>
>      ; if yes, get the split pieces (our siblings)
>      (siblings (if (ly:grob? orig)
>          (ly:spanner-broken-into orig) '() )))
>
>        (if (and (>= (length siblings) 2)
>          (eq? (car (last-pair siblings)) tiegrob))
>          (ly:grob-set-property! (ly:grob-object (ly:spanner-bound
> tiegrob RIGHT) 'accidental-grob) 'color red))))
>
> testMusic = \relative
> {
>    \override Tie #'after-line-breaking = #tie-callback
>    cis'2 cis! ~ \break
>    cis
> }
>
> \score { \testMusic }
> %%%%%%%%%%%%%
>
> But when I try
>
>      (ly:grob-set-property! (ly:grob-object (ly:spanner-bound tiegrob
> RIGHT) 'accidental-grob) 'break-visibility #(#f #f #f))
>
> nothing happens. Am I even close to on the right track?

Not really, although your approach should work in most cases. For Accidentals, 
though, the code that places a tied accidental after a line break isn't 
accessible from scheme (it lives in lily/accidental.cc, in the print 
function).

Anyway, here's a patch (to be applied with "git am") that implements a new 
property, 'hide-tied-accidental-after-break, in the Accidental grob. I'll 
apply it soonish unless there are complaints.

Cheers,
Joe

Attachment: 0001-Make-tied-accidentals-after-line-breaks-configurable.patch
Description: Text Data


reply via email to

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