lilypond-user
[Top][All Lists]
Advanced

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

Re: parenthesize chord


From: address@hidden
Subject: Re: parenthesize chord
Date: Sat, 22 Sep 2012 20:26:13 +0200

On 22 sept. 2012, at 20:11, TaoCG <address@hidden> wrote:

> Is it possible to put put single parentheses around a chord?
> If I parenthesize a chord each note gets a pair of parentheses on its own.
> 
> 

One of many possible hacks...

#(define (parenthesize-elements grob . rest)
(let* ((refp (if (null? rest)
                 grob
                 (car rest)))
       (elts (ly:grob-object grob 'elements))
       (x-ext (ly:relative-group-extent elts refp X))
       (stencils (ly:grob-property grob 'stencils))
       (lp (car stencils))
       (rp (cadr stencils))
       (padding (ly:grob-property grob 'padding 0.5)))

  (ly:stencil-add
   (ly:stencil-translate-axis lp (- (car x-ext) padding) X)   
   (ly:stencil-translate-axis rp (+ (cdr x-ext) padding) X))))

\relative c' {
\override NoteColumn #'stencils = 
#parentheses-item::calc-angled-bracket-stencils
\override NoteColumn #'stencil = #parenthesize-elements
<a c e g>
}




reply via email to

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