Dear list,

I use the following stencil (which is derived the bracketify-stencil procedure from lilypond) to draw editorial brackets around rests.

The output looks very nice and more preferable for my use than using \parenthesize (mainly because it changes in size for quarter note rests). However, I would like to ask if it is possible to modify the \override command to have the brackets account for the dots after the rest? Perhaps a higher level stencil that draws the Rest and dots?

Unfortunately I had trouble finding the source code which handles \parenthesize in the lilypond repository, which probably could have helped me.

Thank you,
-William

%%%%%%%%%%
\version "2.25.2"

#(define (wills-bracketify-stencil stil axis thick protrusion vpadding hpadding)
  (let* ((ext (ly:stencil-extent stil axis))
(lb (ly:bracket axis (cons (- (car ext) hpadding) (+ (cdr ext) hpadding)) thick protrusion)) (rb (ly:bracket axis (cons (- (car ext) hpadding) (+ (cdr ext) hpadding)) thick (- protrusion))))
    (set! stil
(ly:stencil-combine-at-edge stil (other-axis axis) 1 rb vpadding))
    (set! stil
(ly:stencil-combine-at-edge stil (other-axis axis) -1 lb vpadding))
    stil))

\relative a {
\override Rest.stencil = #(lambda (grob) (wills-bracketify-stencil (ly:rest::print grob) Y 0.15 0.5 0.2 0.6))
  r1
  r2. r4
  a1\rest
}
%%%%%%%%%%


--
+ ------------------------------------------- +
|   William Rehwinkel - Oberlin College and   |
|                          Conservatory '24   |
|        will...@williamrehwinkel.net         |
| PGP key:                                    |
| https://ftp.williamrehwinkel.net/pubkey.txt |
+ ------------------------------------------- +

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to