lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GrandStaff vertical distance


From: foxfanfare
Subject: Re: GrandStaff vertical distance
Date: Thu, 11 Oct 2018 13:13:17 -0700 (MST)

Lukas-Fabian Moser wrote
>> 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@

> https://lists.gnu.org/mailman/listinfo/lilypond-user

Thank you for this little function Lukas! It is very good and useful. Would
it be possible to add to the list the choice for "square" or "bracket"? Some
editions are using squares for grouping Violins 1-2.

As suggested by David, it would be then enough "user-level" and complete to
be documented, don't you think?





--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]