David Nalesnik <david.nales...@gmail.com> 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 _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user