Jean-Charles Malahieude wrote:

Could anyone help me finish this BWV246 project?

Well, I don't know anything about figured bass but it seems that Lilypond's square brackets are not intended to be spread apart. add_brackets is called eventwise, and at each call initialises its local variable "inside" to false. And I didn't find a regtest demonstrating your spreading.

But if you want to hack your way to the finish have a look at half-bfb. This assumes that the square brackets fill the stencil-extents and makes its own (single) bracket to fit these, honoring a few things like thickness and padding. But because no continuation mechanism is involved you have to check that the [ and ] are set at the same height.
Maybe you could adapt this for a different bracket style?


Cheers, Robin
\version "2.16.0"

#(define (half-bfb which-side) (lambda (grob)
  (let* (
    (dir-h (if (negative? which-side) -1 +1)) ;; clamp to LEFT or RIGHT
    (layout (ly:grob-layout grob))
    (line-thickness (ly:output-def-lookup layout 'line-thickness))
    (thickness (ly:grob-property grob 'thickness 1)) 
    (th (* line-thickness thickness))
    (hth (/ th 2))
    (tip-lo-h (car (ly:grob-property grob 'edge-height)))
    (tip-hi-h (cdr (ly:grob-property grob 'edge-height)))
    (bfb (ly:enclosing-bracket::print grob))
    (bfb-x (ly:stencil-extent bfb X))
    (bfb-y (ly:stencil-extent bfb Y))
    (stem-v (interval-widen bfb-y (- hth))) 
    (stems-h (interval-widen bfb-x (- hth))) 
    (single-bracket (lambda (grob) 
      (grob-interpret-markup grob (markup 
        #:translate (cons ((if (negative? dir-h) car cdr) stems-h) (cdr stem-v)) 
        #:scale (cons (- dir-h) -1)
        #:combine #:draw-line (cons tip-hi-h 0) #:combine 
        #:draw-line (cons 0 (interval-length stem-v))
        #:translate (cons 0 (interval-length stem-v))
        #:draw-line (cons tip-lo-h 0))))))
    (single-bracket grob))))


bfbJustOpen = 
\once \override FiguredBass.BassFigureBracket #'stencil =  #(half-bfb LEFT)
bfbJustClose = 
\once \override FiguredBass.BassFigureBracket #'stencil =  #(half-bfb RIGHT)


<<
  \new Voice  
  { 
    \clef bass 
    \key g \minor
    g1 
    g4 a4 bes4 ees4
  }
  \new FiguredBass  \with { implicitBassFigures = #'(0) } 
  {
    \figuremode 
    { 
      s1
      \bfbJustOpen <[6 0]>4 \bfbJustClose <[6 5]> s2
    } 
  }
>>

<<attachment: half-bfb.png>>

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to