On Fri, Sep 23, 2011 at 8:59 AM, Dmytro O. Redchuk
<[email protected]>wrote:
> On Fri 23 Sep 2011, 10:30 luis jure wrote:
> > i see that this override changes the placement of all the objects
> > belonging to Script, including articulation marks like accent and the
> > rest. anyway, i prefer to use a global \override in my template, instead
> > of individual tweaks.
> >
> > i understand one cannot adjust with \override the properties of
> individual
> > objects belonging to script?
> If i understtod your right, you'd like to \override something for, let's
> say,
> tenuto only. I believe it's possible; i would start with this approach:
>
> %-------------
> \displayMusic { c''1-- }
> %-------------
>
> Compiling this we can see in log/terminal:
>
> %-------------
> (make-music
> 'SequentialMusic
> 'elements
> (list (make-music
> 'EventChord
> 'elements
> (list (make-music
> 'NoteEvent
> 'duration
> (ly:make-duration 0 0 1 1)
> 'pitch
> (ly:make-pitch 1 0 0))
> (make-music
> 'ArticulationEvent
> 'articulation-type
> "tenuto")))))
> %-------------
>
> So, this 'ArticulationEvent has an 'articulation-type = "tenuto".
>
> As we can use a function for \override:
> \override Script #'padding = #(padding-for-tenuto)
> --- we can imagine a function which takes a grob as an argument and checks
> if
> an articulation is "tenuto" and returns .75 if it is, or "default value"
> otherwise.
>
> So, what you need is posible, if it's possible to get 'articulation-type
> from
> grob (which would be passed to our function as an argument). And if it is
> possible to return "default value" for any other but "tenuto".
>
> To be honest, i don't know if it's possible .)
>
> ;; If it was --- would be better to modify "our function"
> ;; to accept default value for tenuto:
> \override Script #'padding = #(padding-for-tenuto .75)
> ;;;
>
I was experimenting with this approach, but 'padding doesn't seem to respond
when set to a procedure. In the following snippet, the first override
works, the second doesn't. Am I missing something?
\version "2.14.2"
{
\once \override Script #'Y-offset = #(lambda (grob) -3)
c''1_-
\once \override Script #'padding = #(lambda (grob) 3)
c''1_-
}
-David
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user