lilypond-user
[Top][All Lists]
Advanced

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

Re: left-aligned dynamics


From: David Nalesnik
Subject: Re: left-aligned dynamics
Date: Mon, 25 Jan 2010 19:01:49 -0600

Hello,

Fiddling around with the snippet "Centering markup on noteheads automatically," http://lsr.dsi.unimi.it/LSR/Item?id=637 I came up with something which might be useful (or duplicate a far easier solution!). I realize that it doesn't address the problem of center-aligning only the dynamic (the function seems to align the left edge of the dynamic with the note -- hence my guess at an offset of 0.6).  Of course, this offset would have to be adjusted for "pp" "ppp," etc.  At least this will give similar results for "p, dolce" "p, espressivo" and so on.

\version "2.12.3"

pcantabile = #(
  make-dynamic-script (
   markup #:line ( 
        #:dynamic "p" #:hspace -1 #:normal-text   #:italic ", cantabile"
   )
 )
)

dynamicTextLeftAlign = \once \override DynamicText #'X-offset =
#(lambda (grob)
    (-
      (+
        (ly:self-alignment-interface::x-aligned-on-self grob)
        (interval-center
        (ly:grob-robust-relative-extent grob grob X))) 
     0.6))

  \dynamicTextLeftAlign
  a'\pcantabile b' c' d' 
}

________________
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]