lilypond-devel
[Top][All Lists]
Advanced

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

Re: Parenthesizing rests


From: Reinhold Kainhofer
Subject: Re: Parenthesizing rests
Date: Thu, 27 Mar 2008 15:39:52 +0100
User-agent: KMail/1.9.6

Am Donnerstag, 27. März 2008 schrieb Graham Percival:
> On Thu, 27 Mar 2008 14:42:18 +0100
>
> Reinhold Kainhofer <address@hidden> wrote:
> > In particular, if the argument is an event chord, map the
> > parenthesize to all its children (in all other cases use the old
> > behavior)... This means that also all articulations etc. get
> > parentheses (and all notes in a chord like \parenthesize <c e g>).
> > I'm not sure what is better: to apply the parentheses only to notes
> > and rests or to all children, as this patch does it.
>
> I would say that only mapping it to notes and rests is better.  If
> the user really wanted articulations parenthesized, he could write
>   \parenthesize c4 \parenthesize -.

Okay, then the parenthesize function gets a little bit longer:
parenthesize =
#(define-music-function (parser loc arg) (ly:music?)
   (_i "Tag @var{arg} to be parenthesized.")
   (if (memq 'event-chord (ly:music-property arg 'types)) 
     (map 
       (lambda (ev) 
         (if (or (memq 'note-event (ly:music-property ev 'types))
           (memq 'rest-event (ly:music-property ev 'types)))
           (set! (ly:music-property ev 'parenthesize) #t)
         )
       )
       (ly:music-property arg 'elements))
     (set! (ly:music-property arg 'parenthesize) #t)
   )
   arg)

An example including that code is attached, will submit it to the LSR in the 
near future.

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/

Attachment: parenthesize_on_single_notes.ly
Description: Text Data

Attachment: parenthesize_on_single_notes.pdf
Description: Adobe PDF document


reply via email to

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