lilypond-user
[Top][All Lists]
Advanced

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

Re: DynamicLineSpanner padding


From: Trevor Bača
Subject: Re: DynamicLineSpanner padding
Date: Sun, 3 Dec 2006 22:32:22 -0600

On 12/3/06, Orm Finnendahl <address@hidden> wrote:
Hi Mats,

thanks for the reply.

Am 03. Dezember 2006, 20:33 Uhr (+0100) schrieb Mats Bengtsson:
> This problem has been discussed before and in the mailing list
> archives

do you have any idea how the thread was called? I presume, the
workaround is similar to using a \strut box in TeX?

Hi Orm,

I think dynamics (and lots of other stuff) *top*-align by default.
Odd, but there it is.

I asked about bottom alignment in this post where Kieren offered a
workaround using transparent letters:

 http://lists.gnu.org/archive/html/lilypond-user/2006-09/msg00037.html

Later in September Markus Schneider gave the really lovely suggestion
of using a "fake" transparent "f" (which has both appropriate
ascenders and descenders) together with the \combine markup command to
force the "fake" f to take up no space. Kinda like a strut, but
inheriting the dimensions of the "f" glyph. Markus's mail was sent
September 18, but I'll be damned if I can make Namazu reveal the
correct thread through searching. (Namazu seems to just completely
shut down every once in a while.)

I now have a standard.scm that I \include in every Lily input file,
starting with definitions like these, taken directly from Markus's
suggestion:

ppX = #(make-dynamic-script (markup #:combine #:transparent #:dynamic
"f" #:line(#:hspace 0 #:dynamic "pp" #:hspace 0)))
pX = #(make-dynamic-script (markup #:combine #:transparent #:dynamic
"f" #:line(#:hspace 0 #:dynamic "p" #:hspace 0)))
mpX = #(make-dynamic-script (markup #:combine #:transparent #:dynamic
"f" #:line(#:hspace 0 #:dynamic "mp" #:hspace 0)))
fX = #(make-dynamic-script (markup #:combine #:transparent #:dynamic
"f" #:line(#:hspace 0 #:dynamic "f" #:hspace 0)))
ffX = #(make-dynamic-script (markup #:combine #:transparent #:dynamic
"f" #:line(#:hspace 0 #:dynamic "ff" #:hspace 0)))

And if you check for the thread from around September 18 you can see
some fairly complex examples of the same sort of thing working with
spanner edge text, too, like here:

\new Staff \with {
 \override TextSpanner #'dash-fraction = #'()
 \override TextSpanner #'direction = #down
 \override TextSpanner #'bound-padding = #1
} <<
 \time 3/8
 \new Voice {
    c'8 c'8 c'8
 }
 \new Voice \with {
    \override TextSpanner #'staff-padding = #3
 } {
    \override TextSpanner #'edge-text = #(cons
       (markup #:combine #:transparent "f" "a")
       (markup #:combine #:transparent "f" " "))
    s8 \startTextSpan
    \override TextSpanner #'edge-text = #(cons
       (markup #:combine #:transparent "f" "b")
       (markup #:combine #:transparent "f" "c"))
    s8 \stopTextSpan \startTextSpan
    s8 \stopTextSpan
 }
 \new Voice \with {
    \override TextSpanner #'staff-padding = #5.5
 } {
    \override TextSpanner #'edge-text = #(cons
       (markup #:combine #:transparent "f" "d")
       (markup #:combine #:transparent "f" " "))
    s8 \startTextSpan
    \override TextSpanner #'edge-text = #(cons
       (markup #:combine #:transparent "f" "d")
       (markup #:combine #:transparent "f" "f"))
    s8 \stopTextSpan \startTextSpan
    s8 \stopTextSpan
 }
 \new Voice \with {
    \override TextSpanner #'staff-padding = #8
 } {
    \override TextSpanner #'edge-text = #(cons
       (markup #:combine #:transparent "f" "g")
       (markup #:combine #:transparent "f" " "))
    s8 \startTextSpan
    \override TextSpanner #'edge-text = #(cons
       (markup #:combine #:transparent "f" "h")
       (markup #:combine #:transparent "f" "i"))
    s8 \stopTextSpan \startTextSpan
    s8 \stopTextSpan
 }


(I personally think that at least dynamics should exhibit baseline
alignment by default, but at least there's an easy workaround with
definitions like those above.)


--
Trevor Bača
address@hidden

reply via email to

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