Dear LilyPonders,
I've been trying to combine two solutions in the LSR, but I haven't been able to figure out how. I want *square brackets* for parenthesizing a group of notes
1/ Parenthesize a group of notes using a Scheme function
2/ Using brackets instead of parentheses for \parenthesize
Any advice would be appreciated.
Hi Matt,
LSR gives these:
%%% LSR 564 %%%
#(define-public (bracket-stencils grob)
(let ((lp (grob-interpret-markup grob (markup #:fontsize 3.5 #:translate (cons -0.3 -0.5) "[")))
(rp (grob-interpret-markup grob (markup #:fontsize 3.5 #:translate (cons -0.3 -0.5) "]"))))
(list lp rp)))
%%% LSR 902 %%%
startParenthesis = {
\once \override Parentheses.stencils = #(lambda (grob)
(let ((par-list (parentheses-interface::calc-parenthesis-stencils grob)))
(list (car par-list) point-stencil )))
}
endParenthesis = {
\once \override Parentheses.stencils = #(lambda (grob)
(let ((par-list (parentheses-interface::calc-parenthesis-stencils grob)))
(list point-stencil (cadr par-list))))
}
%%% END %%%
So plugging 564 into 902 maybe looks something like this:
%%% 564 + 902 %%%
\version "2.25.19"
openBracket = {
\once \override Parentheses.stencils = #(lambda (grob)
(let ((par-list (bracket-stencils grob)))
(list (car par-list) point-stencil )))
}
closeBracket = {
\once \override Parentheses.stencils = #(lambda (grob)
(let ((par-list (bracket-stencils grob)))
(list point-stencil (cadr par-list))))
}
{
\override Parentheses.font-size = #5
\once \override Parentheses.extra-offset = #'(-1 . 0)
\openBracket
<c \parenthesize c'>
d' e' f'
\closeBracket
\parenthesize
g'
}
%%% END %%%
HTH,
Trevor.
--