lilypond-user
[Top][All Lists]
Advanced

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

Re: Parenthesizing rests


From: Mats Bengtsson
Subject: Re: Parenthesizing rests
Date: Wed, 26 Mar 2008 15:19:06 +0100
User-agent: Thunderbird 2.0.0.5 (X11/20070716)

Playing around with \displayMusic, I got a hint on how to obtain a
parenthesized rest:
\version "2.10.0"
\relative c' { c d e
#(ly:export (make-music
 'EventChord
 'elements
 (list (make-music
         'RestEvent
         'parenthesize
         #t
         'duration
         (ly:make-duration 2 0 1 1)))))
}

A skilled Scheme hacker can easily turn this into a music function that applies
the music property in the correct way for a rest of any duration.
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.

   /Mats

Mats Bengtsson wrote:
parenthesized is a layout object property that only is included in the
accidental-interface, where it is used to determine if a cautionary accidental
should be typeset using smaller font or by including it in parentheses.

parenthesize, on the other hand, is a music property, which is used internally by the \parenthesize macro to add parenthesis around note heads or articulations
or ...
For note heads, it only works within chords (I don't understand the implementation
well enough to realize why), which also explains why it doesn't work with
rests. An ugly workaround is to use the technique in the regression test
called stencil-hacking.ly

  /Mats


Wilbert Berendsen wrote:
Op woensdag 26 maart 2008, schreef Aaron Dalton:
I've done some archive searching but there does not appear to be any
solution.  How does one parenthesize rests?  I'm preparing a number of
transcriptions that will eventually be formally published (with Lilypond credited as the engraver) and need to be able to show editorial rests as
well as pitches.  I am having the same problems outlined in the list
archives.

I have no solution, but grepping/looking in the sources I found both references to:
    to_boolean (me->get_property ("parenthesized"))
as well as:
    to_boolean (ev->get_property ("parenthesize"))

note the "d" at the end :)

In music-functions-init.ly the property name 'parenthesize is used.
Which one is correct and could that be the cause of rests not working?

best regards,
Wilbert Berendsen



--
=============================================
        Mats Bengtsson
        Signal Processing
        School of Electrical Engineering
        Royal Institute of Technology (KTH)
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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