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:

\version "2.14.2"

parenthesizeMMR =
#(define-music-function (parser location paddings)(list?)
#{
        #(define ((parenthesizedMMR markup) grob)
          (ly:stencil-combine-at-edge 
            (ly:multi-measure-rest::print grob)
            X UP (grob-interpret-markup grob markup) (+ (car $paddings) -2.2) 
0))
            
        #(define parMarkup
            (markup #:line
               (#:parenthesize 
                #:transparent
                #:translate (cons 0 (cadr $paddings))
                #:pad-x 0
               (#:draw-line (cons (caddr $paddings) (+ (cadddr $paddings) 
1.2))))))
       
\once\override Staff.MultiMeasureRest #'stencil = #(parenthesizedMMR
parMarkup)
       
#})

%------------------ Test
-------------------------------------------------------

\paper {
        ragged-right = ##f
}

\relative c' {
\compressFullBarRests
        R1
\parenthesizeMMR #'(0 0 0 0)
        R1
\parenthesizeMMR #'(0.45 0 0 0)
        R1*2
\parenthesizeMMR #'(-2.2 0 2.2 0)
        R1*3
\parenthesizeMMR #'(0.5 -1.1 0 1)
        R1*4
\parenthesizeMMR #'(-4 -1.1 4.2 1)
        R1*7
        R1
        R1
        R1
        R1      
}

HTH,
  Harm

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


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to