With a little bit of scheme, it should even be easy to make this into
a function accepting to parameters, indicating that k staves starting
with the n'th staff should be braced.
Here is an implementation of that. Unfortunately I do not know if/how it
is possible to define the function (which issues a \set) in such a way
that it might be called in a \with block, which would be neater imho.
But it seems to work anyway...
\version "2.19.80"
\layout {
indent = 35
}
#(define (make-n-copies x n)
(if (> n 0)
(cons x (make-n-copies x (- n 1)))
'()))
#(define (make-delimiter-hierarchy group-list)
; expects a list of pairs of the form (symbol . number) where
; symbol is either brace or noBrace
; number is the number of staves connected by a brace/no brace
(apply append (map (lambda (group-pair)
(if (equal? (car group-pair) 'brace)
(list (cons 'SystemStartBrace
(make-n-copies 'staff (cdr group-pair))))
(make-n-copies 'some-staff (cdr group-pair))))
group-list)))
setBraces = #(define-music-function (group-list) (list?) #{
\set StaffGroup.systemStartDelimiterHierarchy =
#(make-delimiter-hierarchy group-list)
#})
\new StaffGroup <<
\setBraces #'((brace . 2) (noBrace . 2) (brace . 3))
\new Staff = "Staff_violinI" \with { instrumentName = #"Violin I" } { a }
\new Staff = "Staff_violinII" \with { instrumentName = #"Violin II" }
{ a }
\new Staff = "Staff_viola" \with { instrumentName = #"Viola" } { a }
\new Staff = "Staff_cello" \with { instrumentName = #"Cello" } { a }
\new Staff = "Staff_dbass" \with { instrumentName = #"Double Bass" }
{ a }
\new Staff = "Staff_tbass" \with { instrumentName = #"Triple Bass" }
{ a }
\new Staff = "Staff_qbass" \with { instrumentName = #"Quadruple Bass"
} { a }
>>
Best
Lukas
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user