On Sun, Sep 25, 2011 at 6:24 PM, Thomas Morley <
thomasmorle...@googlemail.com> wrote:

> Hi David,
>
> thanks a lot!
>

You're welcome!


>
> I added ls as an argument to the definition to get the possibility to
> access different alists in polyphonic situations:
>

Good idea.

One thought I had is that someone using this might want to be able to
override all the settings without specifying a list of articulations.  So in
that case you could use this:

\version "2.14.2"

#(define ls-1 '(
    ("staccato" . ((color . (0 1 0))(padding . 0.5)))
    ("accent" . ((font-size . 4)(color . (1 0 0))))
    ("tenuto" . ((rotation . (45 0 0)) (padding . 2)(font-size . 10)))
    ("staccatissimo" . ((padding . -10) (color . (0 0 1))))
    ))

#(define ls-2 '(
    ("staccato" . ((color . (0 1 0))))
    ("accent" . ((font-size . 4)(color . (0 1 0))(padding . 1.5)))
    ("tenuto" . ((rotation . (-45 0 0)) (padding . 2)(font-size . 10)))

    ("staccatissimo" . ((padding . -10) (color . (0 0 1))))
    ("coda" . ((color . (0 0 1))))
    ))


#(define ((custom-script-tweaks ls) grob)
   (let* ((type (ly:prob-property (assoc-ref (ly:grob-properties grob)
'cause) 'articulation-type))
          (tweaks (assoc-ref ls type)))
     (if tweaks
         (for-each (lambda (x) (ly:grob-set-property! grob (car x) (cdr x)))
tweaks)
         '())))


one =
\relative c'' {
  f1--
  f1--
  \override  Voice.Script #'before-line-breaking = #(custom-script-tweaks
ls-1)

  f-. f-| f-> f-> f-- f-|

  \revert Script #'before-line-breaking
  f-> f-.
}

two =
\relative c' {
  f1--->
  f1--
  \override  Voice.Script #'before-line-breaking = #(custom-script-tweaks
ls-2)

  f-. f-| f-> f-> f---> f-|

  %\revert Script #'before-line-breaking
  f-> f-.\coda
}

\new Staff <<
   \new Voice { \voiceOne \one }
   \new Voice { \voiceTwo \two }
   >>


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

Reply via email to