Captain Banaynays
Captain Banaynays

Reputation: 11

Two analysis brackets starting on the same note above and below staff

I would like to use two analysis brackets in Lilypond that start on the same note, and have one start above the staff and the other below the staff.

Here is what I tried:

\version "2.24.3"

\layout {
 \context {
  \Voice
  \consists Horizontal_bracket_engraver
  \override HorizontalBracket.direction = #UP
 }
}

\relative c' {
 c\startGroup
 \once \override HorizontalBracket.direction = #DOWN \startGroup
 d e f\stopGroup | g a b c\stopGroup
}

Lilypond complains at compilation about the second bracket being unattached to a note, and it renders the second startGroup incorrectly at the note following.

The other option that I thought would work:

\version "2.24.3"

\layout {
 \context {
  \Voice
  \consists Horizontal_bracket_engraver
  \override HorizontalBracket.direction = #UP
 }
}

\relative c' {
 \once \override HorizontalBracket.direction = #DOWN
 c\startGroup\startGroup
 d e f\stopGroup | g a b c\stopGroup
}

This will compile without error, but will produce two brackets beneath the staff (I guess once really means "for one note").

Is there a way to do this "properly", i.e. without a hacky workaround? I'm pretty sure that starting one of the brackets a note later and just editing the starting position would work, but would have to be adjusted if the page layout changes.

Upvotes: 1

Views: 45

Answers (1)

Dot Rose
Dot Rose

Reputation: 1

I hope this helps!

\version "2.24.3"

\layout {
 \context {
  \Voice
  \consists Horizontal_bracket_engraver
 }
}

\relative c' {
 c-\tweak HorizontalBracketText.direction #DOWN \startGroup
 -\tweak HorizontalBracket.direction #UP \startGroup
 d e f\stopGroup | g a b c\stopGroup
}

lilypond output image

I found I was able to achieve this with the tweak function, which I found an instance of in the Lilypond manual.

Upvotes: 0

Related Questions