lilypond-user
[Top][All Lists]
Advanced

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

Re: parenthesize groups of notes


From: Gilles THIBAULT
Subject: Re: parenthesize groups of notes
Date: Sun, 8 May 2011 11:07:14 +0200

It's probably possible to automate a bit more but that is the general idea.

Something like that :

#(define ((my-stencils start) grob)
(let* ((par-list (parentheses-item::calc-parenthesis-stencils grob))
       (null-par (grob-interpret-markup grob (markup #:null))))
 (if start
    (list (car par-list) null-par)
    (list null-par (cadr par-list)))))

startParenthesis = #(define-music-function (parser location note) (ly:music?)
"Add an opened parenthesis to the left of `note"
#{
 \once \override ParenthesesItem #'stencils = #(my-stencils #t)
 \parenthesize $note
#})

endParenthesis = #(define-music-function (parser location note) (ly:music?)
"Add a closed parenthesis to the right of `note"
#{
 \once \override ParenthesesItem #'stencils = #(my-stencils #f)
 \parenthesize $note
#})


{
 \startParenthesis c'
 d' e' f'
 \endParenthesis g'
}




reply via email to

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