Hi Harm,

On Sat, Sep 24, 2011 at 8:59 AM, Thomas Morley <
thomasmorle...@googlemail.com> wrote:
>
>
> Hi David,
>
> I don't know, why it doesn't work this way. But the following seems to be
> successful:
>
> #(define (proc x y)
>   (lambda (grob) (if (eq? (ly:grob-property grob 'direction) 1)
>           (ly:grob-set-property! grob 'padding x)
>           (ly:grob-set-property! grob 'padding y)
>           )))
>
> \relative c' {
>
>   \once \override  Script #'after-line-breaking =
>       #(proc 5 0.2)
>   c1^-
> %{
>   \once \override  Script #'after-line-breaking =
>       #(lambda (grob) (if (eq? (ly:grob-property grob 'direction) 1)
>           (ly:grob-set-property! grob 'padding 5)
>           (ly:grob-set-property! grob 'padding 0.2)
>
>           ))
>   c1^-
> %}
>   \once \override  Script #'Y-offset =
>       #(lambda (grob) (if (eq? (ly:grob-property grob 'direction) UP) 5
> 0.2))
>   c1^-
> }
>
>
Thanks for the insight!

So then you could do something like this:

\version "2.14.2"

#(define (padding-for-tenuto x)
   (lambda (grob)
     (if (equal? "tenuto" (ly:prob-property (assoc-ref (ly:grob-properties
grob) 'cause) 'articulation-type))
         (ly:grob-set-property! grob 'padding x)
         '())))

#(define (custom-articulation-padding type x)
   (lambda (grob)
     (if (equal? type (ly:prob-property (assoc-ref (ly:grob-properties grob)
'cause) 'articulation-type))
         (ly:grob-set-property! grob 'padding x)
         '())))

\relative c'' {
  \once \override  Script #'after-line-breaking = #(padding-for-tenuto 0.75)
  f1--
  f1--
  \override Script #'after-line-breaking = #(custom-articulation-padding
"accent" 1)
  f->
  f->
  \revert Script #'after-line-breaking
  f->
}

I don't know if I've gotten at the name of the articulation in the best way,
but this works.  One drawback is that there can only be one override of
'after-line-breaking at a time.  So, if you want multiple changes to default
values -- a change to tenuto, a change to accent, etc. -- these should be
added as conditions to the function.  The second function lets you plug in
the name of the articulation you want to override.

Not sure which of the several methods of changing specific articulations is
best, but I hope this proves helpful.

-David
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to