lilypond-user
[Top][All Lists]
Advanced

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

Re: Slur position : "catching" Llilypond values...


From: David Nalesnik
Subject: Re: Slur position : "catching" Llilypond values...
Date: Mon, 14 Feb 2011 16:18:03 -0600

>> Here is my function:
>>
>> offsetBrokenSpanner =
>> #(define-music-function (parser location name offsets) (string? pair?)
>>      #{
>>        \overrideProperty $name #'after-line-breaking #(broken-spanner
>> $offsets)
>>      #}
>> )
>>
>> #(define ((broken-spanner offsets) grob)
>>    (let* (
>>           ; have we been split?
>>           (orig (ly:grob-original grob))
>>
>>           ; 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)) grob))
>>       (ly:grob-set-property! grob 'extra-offset offsets))))
>>

>
> This is something similar:
>
> \version "2.13.48"
>
> #(define ((grob2-extra-offset offset) grob)
>      (let* (
>          (orig (ly:grob-original grob))
>          (siblings (if (ly:grob? orig)
>              (ly:spanner-broken-into orig)
>              '())))
>      (if (and (>= (length siblings) 2)
>          (eq? (car (last-pair siblings)) grob))
>      (ly:grob-set-property! grob 'extra-offset offset))))
>
> albOffset = #(define-music-function (parser location type move) (string?
> pair?) #{
>      \once \override $type #'after-line-breaking = #(grob2-extra-offset
> $move)
> #})
>
>
> Nick
>
Hi, Nick --

The difference that I see between the two versions here is the use of
\once \override vs. \overrideProperty.  I don't know if anything has
changed in the development versions, but in 2.12.3, I get warnings
("not a grob name") and errors ("Grob name should be alphanumeric")
when I use \override with strings such as "Staff.OttavaBracket" and
"Staff.PianoPedalBracket".  This doesn't happen with
\overrideProperty, so you have access to grobs in other contexts.

Best,
David
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-user
>



reply via email to

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