lilypond-user
[Top][All Lists]
Advanced

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

Re: Articulation with parenthesis-open and with parenthesis-close?


From: Rutger Hofman
Subject: Re: Articulation with parenthesis-open and with parenthesis-close?
Date: Fri, 28 Sep 2012 13:54:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0

On 09/28/2012 01:34 PM, Reinhold Kainhofer wrote:
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


Thanks, this is great!

Rutger




reply via email to

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