Hi Reinhold
This is really good! One addition (at least) is needed, though. To
parenthesize dynamics you need to add
(memq 'absolute-dynamic-event (ly:music-property ev 'types))
to the 'or' clause.
Trevor D
----- Original Message -----
From: "Reinhold Kainhofer" <address@hidden>
To: "Graham Percival" <address@hidden>
Cc: <address@hidden>
Sent: Thursday, March 27, 2008 2:39 PM
Subject: Re: Parenthesizing rests
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/
--------------------------------------------------------------------------------
_______________________________________________
lilypond-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-devel