lilypond-user
[Top][All Lists]
Advanced

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

Re: Analysis brackets with text [was: how to get notes without tails?]


From: David Nalesnik
Subject: Re: Analysis brackets with text [was: how to get notes without tails?]
Date: Sun, 30 Aug 2015 17:11:22 -0500

Hi Paul,

On Sun, Aug 30, 2015 at 4:51 PM, Paul Morris <address@hidden> wrote:
Hi David,

On Aug 30, 2015, at 3:16 PM, David Nalesnik <address@hidden> wrote:

LilyPond already has the ability to make analysis brackets, which are attached to note columns and can nest as in the link (HorizontalBracket).  I have an old patch for adding text to these that I will finish up and post.  (I have code for doing this in Scheme, but my approach now is an enhancement of the C++ engraver.)

The attached file is what I used to use when making form handouts.

This is great!  – both the analysis brackets (which I didn’t know about before) and your code for text labels for them.  I’ve often resorted to using Inkscape to add this kind of thing to LilyPond SVGs.

In trying out your code I noticed that it didn’t really work when the text was wider than the bracket (the bracket was pushed over out of place).  So I came up with a revision that handles this, using the “center-stencil-on-stencil” function I recently contributed to the LSR.  See attached.

Good catch.  Thanks!
 

Would be nice to have this in the LSR, at least.  It also might be nice if it could accept a markup instead of a string, so you could change the appearance of the text (size, color, style, etc.).


Actually, you can.  The syntax is just a little awkward, though:

 gluck = \relative c'' {
  \time 3/4
  \key f \major
  \override HorizontalBracket.direction = #UP
  c4-\tweak stencil #(label #{ \markup \italic \center-column { "contrasting" "period" } #}
                       #{ \markup \italic \center-column { "period" "(cont.)" } #})
  \startGroup
  -\tweak stencil #(label "a" "a" )\startGroup
  a8( bes c f)
  f4( e d)
  c d8( c bes c)
  \appoggiatura bes4 a2 g4 \stopGroup
  %\break
  f'8-\tweak stencil #(label "b" "b")\startGroup r a, r d r
  c4( e, f)
  g8( bes) a4 g8( f)
  f2 \stopGroup \stopGroup r4
}

%%%

The plan at the moment is to create a grob HorizontalBracketText.  That will allow easy use of markups through overrides of a 'text property:

\override HorizontalBracketText.text = \markup ...

and tweakability.

Best,
David

reply via email to

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