lilypond-user
[Top][All Lists]
Advanced

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

Hairpins, brackets and dynamics


From: Davide Liessi
Subject: Hairpins, brackets and dynamics
Date: Tue, 24 Apr 2018 09:51:18 +0200

Dear all,
I need to engrave a hairpin in brackets after a \fz.
I tried LSR 771 (http://lsr.di.unimi.it/LSR/Item?id=771) with the
following results:

\version "2.19.65"

%http://lsr.di.unimi.it/LSR/Item?id=771
hairpinBetweenText =
#(define-music-function (leftText rightText) (markup? markup?)
   #{
     \once \override Hairpin.stencil =
     #(lambda (grob)
        (ly:stencil-combine-at-edge
         (ly:stencil-combine-at-edge
          (ly:stencil-aligned-to (grob-interpret-markup grob leftText) Y CENTER)
          X RIGHT
          (ly:stencil-aligned-to (ly:hairpin::print grob) Y CENTER)
          0.6)
         X RIGHT
         (ly:stencil-aligned-to (grob-interpret-markup grob rightText) Y CENTER)
         0.6))
   #})

music = { c'1\fz\> c' c' c' d'1\! }

\score {
  <<
    \new Staff {
      \music
    }
    \new Staff {
      \hairpinBetweenText "[" "]"
      \music
    }
    \new Staff {
      \once \hide DynamicText
      \hairpinBetweenText \markup { \dynamic { fz } "[" } "]"
      \music
    }
    \new Staff {
      \once \override Hairpin.shorten-pair = #'(0 . 2)
      \once \hide DynamicText
      \hairpinBetweenText \markup { \dynamic { fz } "[" } "]"
      \music
    }
  >>
}

Is there a way to make the second Staff look like the last one?
I.e., is it possible to avoid the clash between the dynamic mark and
the hairpin and to automatically shorten the hairpin?

(By the way, in the third and fourth Staff hiding the DynamicText is
not necessary, since the normal \fz and the one in \hairpinBetweenText
are perfectly aligned; however if the DynamicText is omitted instead
of hidden the hairpin is shifted to the right, which I didn't expect.)

Best wishes.
Davide



reply via email to

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