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 Kastrup
Subject: Re: Pedal bracket to end of note duration
Date: Sun, 05 Mar 2017 16:36:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

David Nalesnik <address@hidden> writes:

> 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.

Shouldn't to-barline do something of that kind?  That would have been my
first suggestion but doesn't appear to work, regardless of whether the
spanner ends with the last note or the following note.

The question is whether it should do something helpful?  The default
documentation suggests that it _shortens_ spanners to the _preceding_
bar-line.  We could make this do something sensible depending on the
grob in question, or we could add a direction or something to make it
possible just which direction a bar-line might sit in order to have an
influence.

-- 
David Kastrup



reply via email to

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