On 28/09/2012 12:06, Rutger Hofman wrote:
in my current score, there are long, consecutive lists of notes with
articulations (dashes) in parentheses. Now it would improve
readability a lot if the first of these parenthesized dashes has only
a parenthesis-open, the last has only a parenthesis-close, and the
rest has a regular parenthesis. I have seen this in printed music more
than once.
Coincidentally, I had the same problem the day before yesterday. Here is
what I have (using the \parenthesize command and modifying its behavior):
%%%%%%%%%%%%%
#(define-public (parentheses-item::calc-parenthesis-left-stencils grob)
(let* ((font (ly:grob-default-font grob)))
(list (ly:font-get-glyph font "accidentals.leftparen") empty-stencil)))
#(define-public (parentheses-item::calc-parenthesis-right-stencils grob)
(let* ((font (ly:grob-default-font grob)))
(list empty-stencil (ly:font-get-glyph font "accidentals.rightparen"))))
parenthesizeLeft = #(define-music-function (parser loc arg) (ly:music?)
#{
-\tweak ParenthesesItem #'stencils
#parentheses-item::calc-parenthesis-left-stencils
-\parenthesize $arg
#})
parenthesizeRight = #(define-music-function (parser loc arg) (ly:music?)
#{
-\tweak ParenthesesItem #'stencils
#parentheses-item::calc-parenthesis-right-stencils
-\parenthesize $arg
#})
%%%%%%%%%%%%%
The \parenthesizeLeft and \parenthesizeRight work exactly like
\parenthesize, i.e.:
e4.-\parenthesizeLeft->\> <e c>4.-\parenthesizeRight-> | % 3
HTH,
Reinhold