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 14:42:18 +0100
User-agent: KMail/1.9.6

Am Donnerstag, 27. März 2008 schrieb Reinhold Kainhofer:
> Am Donnerstag, 27. März 2008 schrieb Valentin Villenave:
> > >  By the way, isn't it a bug that the default implementation of
> > >  \parenthesize doesn't
> > >  handle this? If I understand correctly, this is also the reason that
> > > you cannot
> > >  parenthesize a single note without enclosing it in a chord.
> >
> > We are precisely finishing to rewrite Editorial Notation in the GDP
> > ("we" meaning "Jay"). That could be a nice opportunity to make this
> > command simpler; however wouldn't it break the features described in
> > http://lsr.dsi.unimi.it/LSR/Item?id=283 and
> > http://lsr.dsi.unimi.it/LSR/Item?id=421 ?
>
> If fixed correctly, I don't think so. Afaics, the parenthesize function
> defined in music-functions-init.ly would need to check whether the arg is
> an EventChord with only one child note or rest, in which case the property
> should be set for this note and not the whole chord...

As a quick hack, one can change the definition of parenthesize to:
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)) 
     (let* ((elm (ly:music-property arg 'elements)))
       (map (lambda (x) (set! (ly:music-property x 'parenthesize) #t)) elm)
     )
     (set! (ly:music-property arg 'parenthesize) #t)
   )
   arg)

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.

Patch and example is attached.

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

Attachment: parenthesize_on_single_notes.patch
Description: Text Data


reply via email to

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