[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Controlling horizontal bracket start position after a line break?
From: |
Neil Puttock |
Subject: |
Re: Controlling horizontal bracket start position after a line break? |
Date: |
Wed, 14 Sep 2011 23:20:53 +0100 |
On 13 September 2011 23:50, harm6 <address@hidden> wrote:
> modifying some definitions developed by Mike and David in this thread
> http://old.nabble.com/shorten-a-broken-hairpin-at-a-linebreak--td32343028.html
> I hope this will do the job:
This is a bit complicated. :)
> \version "2.14.2"
>
> #(define (has-interface? grob interface)
> (member interface
> (assoc-get 'interfaces
> (ly:grob-property grob 'meta))))
grob::has-interface
> #(define (find-system grob)
> (if (has-interface? grob 'system-interface)
> grob
> (find-system (ly:grob-parent grob X))))
ly:grob-system
> #(define (first-musical-column grobl)
> (if (not (eqv? #t (ly:grob-property (car grobl) 'non-musical)))
> (car grobl)
> (first-musical-column (cdr grobl))))
HorizontalBracket carries an array of NoteColumn grobs, so the bound
is already available for the broken spanner:
\version "2.15.11"
\layout { ragged-right = ##t }
\new Voice \with {
\consists "Horizontal_bracket_engraver"
\override HorizontalBracket #'after-line-breaking =
#(lambda (grob)
(let* ((orig (ly:grob-original grob))
(broken-intos (ly:spanner-broken-into orig)))
(and (pair? broken-intos)
(>= (length broken-intos) 2)
(eq? (car (last-pair broken-intos)) grob)
(let ((cols (ly:grob-array->list (ly:grob-object grob 'columns))))
(set! (ly:grob-property grob 'edge-height) '(0 . 1))
(ly:spanner-set-bound! grob LEFT (car cols))))))
}
{
c'1 \startGroup
d'1 \break
e'1
f'1 \stopGroup
}
Cheers,
Neil