lilypond-user
[Top][All Lists]
Advanced

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

Re: Accidental in brackets


From: David Nalesnik
Subject: Re: Accidental in brackets
Date: Mon, 5 Dec 2016 10:41:19 -0600

Hi Urs,

On Mon, Dec 5, 2016 at 10:30 AM, tisimst <address@hidden> wrote:
> Urs,
>
> On Mon, Dec 5, 2016 at 7:54 AM, Mike Solomon [via Lilypond] <[hidden email]>
> wrote:
>>
>> 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.
>
>
> Here's another option for you that I created recently that creates brackets
> roughly the same size as the real parentheses glyphs, so I think it (the
> second one I describe in that message) tends to look a little better than
> relying on the stencil of the accidental because, for example, you'll get
> very different results for a flat glyph vs. a natural glyph (as will Mike's
> code):
> http://lists.gnu.org/archive/html/lilypond-user/2016-11/msg00928.html
>
> Best,
> Abraham
>

Haven't examined the other alternatives proposed, but here's something
I just did.  It's based on a rewrite of functions in
lily/accidental.cc

HTH,
David

Attachment: accidental-brackets.ly
Description: Text Data


reply via email to

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