lilypond-user
[Top][All Lists]
Advanced

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

Re: Accidental in brackets


From: Mike Solomon
Subject: Re: Accidental in brackets
Date: Mon, 5 Dec 2016 16:52:01 +0200

Hey!

Total hack, but if you check out scm/stencil.scm, you’ll see how parentheses are made…

(define-public (parenthesize-stencil
                stencil half-thickness width angularity padding)
  "Add parentheses around @var{stencil}, returning a new stencil."
  (let* ((y-extent (ly:stencil-extent stencil Y))
         (lp (make-parenthesis-stencil
              y-extent half-thickness (- width) angularity))
         (rp (make-parenthesis-stencil
              y-extent half-thickness width angularity)))
    (set! stencil (ly:stencil-combine-at-edge stencil X LEFT lp padding))
    (set! stencil (ly:stencil-combine-at-edge stencil X RIGHT rp padding))
    stencil))

So it looks like you can substitute in make-connected-path-stencil for make-parenthesis-stencil, using sensible parameters for the connected path based on the y extent and the width.

~Mike


On 5 December 2016 at 16.46.16, Urs Liska (address@hidden) wrote:

Hi all,

I don't seem to find the right thing, neither in the docs, the LSR nor
the list archive. I need to put square brackets around some accidentals
in order to differentiate them from default parentheses.

I don't find the way to create the respective stencil for this.

It has to be possible to do that \once, and I assume I'll run into the
situation where I will need both round and square ones within a chord.

Any help available?

Thanks
Urs


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

reply via email to

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