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: Reinhold Kainhofer
Subject: Re: Articulation with parenthesis-open and with parenthesis-close?
Date: Fri, 28 Sep 2012 13:34:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0

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

-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://www.kainhofer.com
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * Edition Kainhofer, Music Publisher, http://www.edition-kainhofer.com




reply via email to

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