[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: text on analysis brackets
From: |
David Nalesnik |
Subject: |
Re: text on analysis brackets |
Date: |
Fri, 8 Jul 2011 15:09:21 -0500 |
On 7/8/11, David Nalesnik <address@hidden> wrote:
> Hi, all --
>
> I'd like to be able to add text to analysis brackets, and I'm running
> into a problem with nested brackets.
>
> In the attached file, I'd like the last bracket to have "b" over it,
> but it takes its text from the previous incomplete bracket.
>
> (It seems I can add as many nested brackets as I like with different
> text, as long as they have the same starting-point.)
>
> Is there anything I can do to make this approach work?
>
Hi, again --
It just dawned on me that I can use different voices, like so:
\version "2.14.1"
#(define (label text)
(lambda (grob)
;; adapted from LSR snippet, "Center text below hairpin dynamics"
(ly:stencil-aligned-to
(ly:stencil-combine-at-edge
(ly:stencil-aligned-to (ly:horizontal-bracket::print grob) X CENTER)
Y (ly:grob-property grob 'direction)
(ly:stencil-aligned-to (grob-interpret-markup grob (markup
text)) X CENTER)
0.2)
X LEFT)))
\layout {
\context {
\Voice
\consists "Horizontal_bracket_engraver"
}
}
\new Staff <<
\new Voice \relative c'' {
\override HorizontalBracket #'direction = #UP
c4-\tweak #'stencil #(label "A")\startGroup
-\tweak #'stencil #(label "a")\startGroup
d4\stopGroup
e4
d4\stopGroup
}
\new Voice {
s4
s4
\override HorizontalBracket #'direction = #UP
\override NoteColumn #'ignore-collision = ##t
\hideNotes
e''4-\tweak #'stencil #(label "b")\startGroup
d''4\stopGroup
}
>>
So to refine the original question: Is there any way to do this
without multi-voice trickery?
Best,
David