lilypond-user
[Top][All Lists]
Advanced

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

Re: Whole measure rests in parentheses


From: harm6
Subject: Re: Whole measure rests in parentheses
Date: Sat, 6 Aug 2011 14:22:40 -0700 (PDT)


harm6 wrote:
> 
> 
> Elwro wrote:
>> 
>> Dear Group,
>> 
>> I'd like the input
>> 
>> \parenthesize R1
>> 
>> to produce a whole measure rest in parentheses. (...)
>> 
>> Best regards,
>> 
>> Leszek.
>> 
> 
> Hi,
> 
> here's another, more elaborated workaround:
> 
> (...)
> 
> HTH,
>   Harm
> 
> 

Hi,

this seems to work fine, with one exception: if you change the
staff-position of R1, the shifting of the ParenthesesItem moves badly. But
not with R1*2 etc. 
I think it is  http://code.google.com/p/lilypond/issues/detail?id=1604 issue
1604 . In this case you may want to change the values of

(if (> 0.9 alignY)
    (cons  0 (* -1 (- alignY 0.3)))    <------------------- here!
    (cons  0 (+ (* -1 alignY) 0.4)))

Code:

\version "2.14.2"

parMMR = {
\once\override MultiMeasureRest #'minimum-length = #10
\once\override Staff.MultiMeasureRest #'stencil =
        #(lambda (grob)
          (let* ((mrkp-ext-x (ly:stencil-extent (ly:multi-measure-rest::print 
grob)
X))
                 (mrkp-ext-y (ly:stencil-extent (ly:multi-measure-rest::print 
grob)
Y))
                 (grob-length (interval-length mrkp-ext-x))
                 (grob-height (interval-length mrkp-ext-y))
                 (alignX grob-length)
                 (alignY grob-height)
                 (mrkp (markup
                        #:parenthesize  
                        #:transparent
                        #:translate 
                        (if (> 0.9 alignY)
                            (cons  0 (* -1 (- alignY 0.3)))
                            (cons  0 (+ (* -1 alignY) 0.4)))  
                        #:draw-line (cons alignX (+ 0.8 grob-height))))
               )
               
              (ly:stencil-combine-at-edge 
                (ly:multi-measure-rest::print grob)
                X UP
                (grob-interpret-markup grob mrkp) 
                (- (* -1 alignX) 1.4) 0)
              ))
}
                      
\relative c'' {
        %\override MultiMeasureRest #'staff-position = #4
        \compressFullBarRests
                \parMMR
        R1  
        \parMMR
        R1*2
        \parMMR
        R1*3
        \parMMR
        R1*4
        \parMMR
        R1*5
        \parMMR
        R1*6
        \parMMR
        R1*7
}

Regards,
  Harm
-- 
View this message in context: 
http://old.nabble.com/Whole-measure-rests-in-parentheses-tp32197963p32210008.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.




reply via email to

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