[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GrandStaff vertical distance
From: |
Lukas-Fabian Moser |
Subject: |
Re: GrandStaff vertical distance |
Date: |
Thu, 11 Oct 2018 17:42:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
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
- GrandStaff vertical distance, foxfanfare, 2018/10/09
- Re: GrandStaff vertical distance, Lukas-Fabian Moser, 2018/10/11
- Re: GrandStaff vertical distance,
Lukas-Fabian Moser <=
- Re: GrandStaff vertical distance, David Kastrup, 2018/10/11
- Re: GrandStaff vertical distance, Lukas-Fabian Moser, 2018/10/11
- Re: GrandStaff vertical distance, David Kastrup, 2018/10/11
- Re: GrandStaff vertical distance, David Kastrup, 2018/10/11
- Re: GrandStaff vertical distance, foxfanfare, 2018/10/11
- Re: GrandStaff vertical distance, Lukas-Fabian Moser, 2018/10/11
- Re: GrandStaff vertical distance, foxfanfare, 2018/10/12
- Re: GrandStaff vertical distance, Lukas-Fabian Moser, 2018/10/12
- Re: GrandStaff vertical distance, Aaron Hill, 2018/10/12
- Re: GrandStaff vertical distance, foxfanfare, 2018/10/13