Dear All,

I frequently need to have overlapping horizontal brackets. This means that
I have to add hidden notes to my scores to attach them to. (Brackets won't
attach to spacer rests unless they live in a Staff context, in which case
you can't have more than one at a time. Adding brackets to both contexts
creates two brackets at a time.)

This means I need to add a voice with notes that are a) invisible and b)
have no effect on the spacing of other music on the staff. I haven't found
a way to do this, or even figured out how to predict what will happen when
I try. My main options are a) \hideNotes, b) stencil=##f, c)
stencil=#point-stencil, or d) same as previous, but with rests.

So far I have found that every option has /some/ effect on the surrounding
music. In some cases option a) is best, and sometimes another option. In a
complex score it's hard to even know which is best unless you make a small
example to test.

It's hard to create a minimal example that demonstrates this, so I have
attached an image and accompanying code to illustrate. I'm only concerned
about the notes (brackets always require tweaking in these situations). In
this case option c) looks best, but there are other times when
#point-stencil produces crazy output. Normally a) is best, but as you can
see it sometimes causes long stems and such, meaning I have to choose the
pitches of invisible notes carefully...

I have battled with this for a long time, so any help would be much
appreciated.

Kevin

Attachment: test.pdf
Description: Adobe PDF document

\version "2.19.34"

global = {
  \key aes \major
  \partial 8
  \clef bass
}

\score {
  \new Voice \relative {
    \mark \markup "normal"
    \global
    bes,8 ees4 c bes8 aes \grace { g16[ aes] } g4
  }
}

\score {
  \new Staff <<
    \mark \markup "transparent"
    \global
    \new Voice \relative {
      bes,8-\tweak direction #1 \startGroup
      ees4\stopGroup c\startGroup
      bes8\startGroup aes\grace { g16[ aes] } g4\stopGroup \stopGroup
    }
    \new Voice \relative {
      \hideNotes
      \override NoteColumn.ignore-collision = ##t
      s8
      ees4 -\tweak direction #1 \startGroup \startGroup c\stopGroup
      bes8\stopGroup
    }
  >>
}

\score {
  \new Staff <<
    \mark \markup "no stencil"
    \global
    \new Voice \relative {
      bes,8-\tweak direction #1 \startGroup
      ees4\stopGroup c\startGroup
      bes8\startGroup aes\grace { g16[ aes] } g4\stopGroup \stopGroup
    }
    \new Voice \relative {
      \omit NoteHead
      \omit Beam
      \omit Flag
      \omit Stem
      \override NoteColumn.ignore-collision = ##t
      s8
      ees4 -\tweak direction #1 \startGroup \startGroup c\stopGroup
      bes8\stopGroup
    }
  >>
}

\score {
  \new Staff <<
    \mark \markup "point-stencil"
    \global
    \new Voice \relative {
      bes,8-\tweak direction #1 \startGroup
      ees4\stopGroup c\startGroup
      bes8\startGroup aes\grace { g16[ aes] } g4\stopGroup \stopGroup
    }
    \new Voice \relative {
      \override NoteHead.stencil = #point-stencil
      \override Beam.stencil = #point-stencil
      \override Flag.stencil = #point-stencil
      \override Stem.stencil = #point-stencil
      \override NoteColumn.ignore-collision = ##t
      s8
      ees4 -\tweak direction #1 \startGroup \startGroup c\stopGroup
      bes8\stopGroup
    }
  >>
}

\score {
  \new Staff <<
    \mark \markup "rests"
    \global
    \new Voice \relative {
      bes,8-\tweak direction #1 \startGroup
      ees4\stopGroup c\startGroup
      bes8\startGroup aes\grace { g16[ aes] } g4\stopGroup \stopGroup
    }
    \new Voice \relative {
      \hideNotes
      \override NoteColumn.ignore-collision = ##t
      s8
      r4 -\tweak direction #1 \startGroup \startGroup r\stopGroup
      r8\stopGroup
    }
  >>
}

\layout {
  \context {
    \Voice
    \consists "Horizontal_bracket_engraver"
    \override HorizontalBracket.bracket-flare = #'(0 . 0)
  }
}
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to