lilypond-user
[Top][All Lists]
Advanced

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

Re: Pedal bracket to end of note duration


From: David Nalesnik
Subject: Re: Pedal bracket to end of note duration
Date: Sun, 5 Mar 2017 09:20:51 -0600

Hi,

On Sun, Mar 5, 2017 at 8:06 AM, Knute Snortum <address@hidden> wrote:
> I usually do something like this:
>
> <<
> {
>   c'4 c' c' c'
>   c'1
> }
> {
>   \set Staff.pedalSustainStyle = #'bracket
>   s4 s \sustainOn s s8 s \sustainOff
> }
>>>
>
>
> ---
> Knute Snortum
> (via Gmail)
>
> On Sun, Mar 5, 2017 at 1:52 AM, Andrew Bernard <address@hidden>
> wrote:
>>
>> How can one get the pedal bracket line to extend to the end of the note
>> duration for which the sustain off event is given?
>>
>> Referring to this specific MWE below, I would like the pedal bracket to
>> extend to just before the barline, similar to what one can do with hairpins.
>>
>> I suspect this is a FAQ on the list but I have never been able to unearth
>> a proper solution. And yes, Gould et al. may have rules, but I need this for
>> the MSS that I engrave all the time. I can achieve the effect using shorten
>> pair, but this is always trail and error, and therefore tedious and error
>> prone.
>>

How about something like the following?

It resets the right bound of the spanner to the next PaperColumn or
NonMusicalPaperColumn.  In so doing it gets a bit close to the
next note, so you can use 'shorten-pair for consistent offsets.

%%%%%%%%%%%%
\version "2.19.55"

#(define (encompass-duration grob)
   (let* ((rb (ly:spanner-bound grob RIGHT))
          (sys (ly:grob-system grob))
          (cols (ly:grob-array->list (ly:grob-object sys 'columns)))
          (me-forward (memq rb cols)))
     (if (and me-forward (> (length me-forward) 1))
         (ly:spanner-set-bound! grob RIGHT (cadr me-forward)))
     (ly:piano-pedal-bracket::print grob)))

{
  \override Staff.PianoPedalBracket.stencil = #encompass-duration
  \override Staff.PianoPedalBracket.shorten-pair = #'(0 . 0.5)
  \set Staff.pedalSustainStyle = #'bracket
  c'4\sustainOn c' c' c'\sustainOff
  c'4 c'\sustainOn c'\sustainOff c'
  c'4\sustainOn c' c' c'
  \break
  c'4\sustainOff c' c' c'
}

%%%%%%%

Hope this helps.

David



reply via email to

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