Okay, I got it, sorry for the noise. I had to add (attach-dir . ,LEFT) and (attach-dir . ,RIGHT), respectively to the bound-details. This doesn’t solve the problem with the bracket spanning only one note, but at least I now know how to manually override it to fix it for those occurences.
Anyway, now I’ve stumbled upon another problem related to this code. When I have overriden the ottavaBracket in this manner, after a line break it starts at the beginning of the line and not above the first note. Also, the 8va is not repeated at the beginning of the new line.
\version "2.19.13"
ottavaLineUp = {
\override Staff.OttavaBracket.stencil = #ly:line-spanner::print
\override Staff.OttavaBracket.bound-details = #`((left . ((Y . 0)
(attach-dir . ,LEFT)
(stencil-align-dir-y . ,UP)))
(right . ((Y . 0)
(attach-dir . ,RIGHT)
(text . ,(make-draw-dashed-line-markup (cons 0 -1.2))))))
\override Staff.OttavaBracket.left-bound-info = #ly:line-spanner::calc-left-bound-info-and-text
\override Staff.OttavaBracket.right-bound-info = #ly:line-spanner::calc-right-bound-info
}
ottavaLineDown = {
\override Staff.OttavaBracket.stencil = #ly:line-spanner::print
\override Staff.OttavaBracket.bound-details = #`((left . ((Y . 0)
(attach-dir . ,LEFT)
(stencil-align-dir-y . ,DOWN)))
(right . ((Y . 0)
(attach-dir . ,RIGHT)
(text . ,(make-draw-dashed-line-markup (cons 0 1.2))))))
\override Staff.OttavaBracket.left-bound-info = #ly:line-spanner::calc-left-bound-info-and-text
\override Staff.OttavaBracket.right-bound-info = #ly:line-spanner::calc-right-bound-info
}
#(define-markup-command (topAlign layout props arg)
(markup?)
(let* ((mol (interpret-markup layout props arg)))
(ly:stencil-aligned-to mol Y 1)))
ottavava = {
\ottavaLineUp
\ottava #1
\set Staff.ottavation = \markup \concat \bold \topAlign { "8" \tiny "va" }
}
ottavavb = {
\ottavaLineDown
\ottava #-1
\set Staff.ottavation = \markup \concat \bold { "8" \tiny "vb" }
}
\relative c'' {
\ottavava c1 \break
c
}