lilypond-user
[Top][All Lists]
Advanced

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

Re: Broken Hairpin height not affected by \alterBroken


From: Thomas Morley
Subject: Re: Broken Hairpin height not affected by \alterBroken
Date: Wed, 2 Jul 2014 10:37:25 +0200

2014-07-02 4:37 GMT+02:00 Javier Ruiz-Alma <address@hidden>:
> The 2nd Hairpin.height value in \alterBroken seems to get ignored.  Is this
> a limitation, or my bad syntax?
> I'm dealing with a broken multi-bar hairpin.  Not being able to adjust
> heights per segment results in either too-narrow first or too-wide second
> hairpin segment.
> \version "2.18.2"
> \paper { ragged-right = ##t indent = 0.0 }
> \relative c' {
> \alterBroken height #'( 1.5 0.3 ) Hairpin
> c\< c c c c c c c c c c c \break
> c c c c c c c c\!
> }

Hi Javier,

IMHO the untweaked output of your code is _exactly_ what I want to see
for a broken Hairpin.

Nevertheless, the reason alterBroken does not work here, seems to be
that during an override for Hairpin.height no broken Spanner is
recognized. See the output of this test-code:

\version "2.18.2"

\paper { ragged-right = ##t indent = 0.0 }

%% tests whether broken Hairpins are recognized during an 'height-override
test =
  \override Hairpin.height =
    #(lambda (grob)
      (let* ((orig (ly:grob-original grob))
             (siblings (ly:spanner-broken-into orig)))
      (if (null? siblings)
          (display "\n\tno broken spanner found"))
      ;; default value:
      0.6666))

\relative c' {
  \test
  c1\< c c \break c c c\!
}

Overriding the 'after-line-breaking property will work, though.
(Too lazy to turn it into a music-function)

\version "2.18.2"

%% tweaks a broken Hairpin 'height
height-tweak =
  \override Hairpin.after-line-breaking =
  #(lambda (grob)
    (let* ((orig (ly:grob-original grob))
           (siblings (ly:spanner-broken-into orig)))
    (if (>= (length siblings) 2)
        (begin
          (if (equal? grob (car siblings))
              (ly:grob-set-property! grob 'height 1.5))
          (if (equal? grob (cadr siblings))
              (ly:grob-set-property! grob 'height 0.3))))))

\relative c' {
  \height-tweak
  c1\< c c \break
  c c c\!
}

HTH,
  Harm



reply via email to

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