[Top][All Lists]
[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/
parenthesize_on_single_notes.ly
Description: Text Data
parenthesize_on_single_notes.pdf
Description: Adobe PDF document
parenthesize_on_single_notes.patch
Description: Text Data
- Re: Parenthesizing rests, Wilbert Berendsen, 2008/03/26
- Re: Parenthesizing rests, Mats Bengtsson, 2008/03/26
- Re: Parenthesizing rests, Mats Bengtsson, 2008/03/26
- Re: Parenthesizing rests, Valentin Villenave, 2008/03/26
- Re: Parenthesizing rests, Reinhold Kainhofer, 2008/03/27
- Re: Parenthesizing rests,
Reinhold Kainhofer <=
- Re: Parenthesizing rests, Graham Percival, 2008/03/27
- Re: Parenthesizing rests, Reinhold Kainhofer, 2008/03/27
- Re: Parenthesizing rests, Trevor Daniels, 2008/03/27
- Re: Parenthesizing rests, Reinhold Kainhofer, 2008/03/27
- Re: Parenthesizing rests, Trevor Daniels, 2008/03/27
- Re: Parenthesizing rests, Graham Percival, 2008/03/28
- [PATCH] Re: Parenthesizing rests, Reinhold Kainhofer, 2008/03/28
- Re: [PATCH] Re: Parenthesizing rests, Han-Wen Nienhuys, 2008/03/29
- Re: [PATCH] Re: Parenthesizing rests, Reinhold Kainhofer, 2008/03/30
- Re: [PATCH] Re: Parenthesizing rests, Valentin Villenave, 2008/03/30