Hi everyone

I’m trying to use HorizontalBracket to annotate the intervals between notes of 
a scale.

The example (perhaps not minimal, but almost working) attached shows something 
very close to what I want to achieve.

However there are a few things that need to be fixed, or improved:
1) the brackets remain outside the staff no matter how I fiddle with staff-
padding and padding properties, while I would like them to stay closer to the 
notes;
2) I cannot find an (obvious and) automatic way to have the ends of a bracket 
to align with the center of the note heads. I found a manual workaround by 
setting the shorten-pair property, which is a far from being an optimal 
solution;
3) is there a way to create a V-shaped bracket? The hack I came up with is 
ugly;
4) to have brackets both above and below the notes I have used two voices, one 
with the notes hidden. Is there a faster/less verbose way to obtain the same 
result?

Besides these, it would be nice (but not essential) to have these bracket to 
also follow the slope of an interval.

The summary of my needs can be found in the attached image.

Can anyone shed some light, please?

Thanks
Francesco Napoleoni
\version "2.19.83"

semitone = {
  % How can I obtain a V-shaped bracket?
  \once \override Voice.HorizontalBracket.bracket-flare = #'(3 . 3)
}

tone = {
  \once \override Voice.HorizontalBracket.bracket-flare = #'(0 . 0)
  \once \override Voice.HorizontalBracket.edge-height = #'(0.5 . 0.5)
}

\layout {
  \context {
    \Staff
    \remove "Time_signature_engraver"
    \remove "Collision_engraver"
  }
  \context {
    \Voice
    \consists "Horizontal_bracket_engraver"

    % Is there any better alternative to get the edges of the bracket
    % aligned to the center of the notes?
    \override HorizontalBracket.shorten-pair = #'(0.9 . 1)
  }
}

\score {
  \new Staff \relative c' <<
    \cadenzaOn

    \new Voice {
      \voiceOne
      \tone
      c1\startGroup d\stopGroup
      \semitone
      e\startGroup f\stopGroup
      \tone
      g\startGroup a\stopGroup
      \semitone
      b\startGroup c\stopGroup
    }

    \new Voice \with {
      \override HorizontalBracket.direction = #UP
    } {
      \voiceTwo
      \hideNotes
      c1
      \tone
      d\startGroup e\stopGroup
      \tone
      f\startGroup g\stopGroup
      \tone
      a\startGroup b\stopGroup
      c
    }
  >>
}

Reply via email to