lilypond-user
[Top][All Lists]
Advanced

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

Re: avoid alignment of hairpin and dynamic text


From: Werner LEMBERG
Subject: Re: avoid alignment of hairpin and dynamic text
Date: Sat, 30 Jan 2021 07:59:09 +0100 (CET)

>> How can I avoid the vertical alignment of a hairpin and a dynamic
>> text that starts or stops the hairpin?  For example, in this
>> situation
>>
>>    { f1\< | e''\p }
>>
>> I want to make LilyPond position the `\p` independently of the the
>> crescendo – in particular, I don't want to fiddle with `padding`,
>> `extra-offset`, or something similar to move the `\p' up; LilyPond
>> already knows how to position the `\p` correctly.[*]
>>
>> In other words, how can I influence where a `DynamicLineSpanner`
>> starts and end?
> 
> Try forcing spanner-broken like this:
> 
> 
> \version "2.23.1"
> 
> {
>   f1\tweak spanner-broken ##t \<
>   e''1\p
> }
> 
> 
> This coerces the Dynamic_align_engraver into creating a
> new DyamicLineSpanner instead of reusing the same
> one (lily/dynamic-align-engraver.cc around line 93).

Thanks a lot!

Note that `spanner-broken` is an internal property, not to be modified
by the user.  A search in the code yields the command
`\breakDynamicSpan` as user syntax – introduced more than 10 years ago
in version 2.13.23...  I will document that soon.

Unfortunately, it doesn't cover the case where a dynamic mark is
immediately followed by a hairpin:

  {
    <>^\markup { \typewriter "e''2\\f\\> f2\\p" }
    e''2\f\> f2\p | \break

    <>^\markup { \typewriter "e''2\\f\\breakDynamicSpan\\> f2\\p"
                 (doesn't work) }
    e''2\f\breakDynamicSpan\> f2\p | \break

    <>^\markup { \typewriter "e''2\\f\\> f2\\breakDynamicSpan\\p"
                 (works) }
    e''2\f\> f2\breakDynamicSpan\p | \break
  }

Can this be fixed easily?  This is, making the hairpin listen to a
`BreakDynamicSpanEvent` at the creation time of a
`DynamicLineSpanner`?  It's probably a special case, since the dynamic
mark *should* influence the horizontal position of the hairpin's
starting point.


    Werner

PNG image


reply via email to

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