[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tweaking Hairpin shape
From: |
David Nalesnik |
Subject: |
Re: Tweaking Hairpin shape |
Date: |
Thu, 8 Feb 2018 18:50:08 -0600 |
Hi Stefano,
On Thu, Feb 8, 2018 at 4:43 PM, Stefano Troncaro
<address@hidden> wrote:
> Hello again!
>
> I managed to modify David's translation of ly:hairpin::print to have it use
> two properties, Hairpin.rotate and Hairpin.straight-end, to achieve almost
> all the results I wanted.
Glad you got some use out of this! I like the look of the
straight-edged hairpins.
>
> The idea is that Hairpin.rotate can be either a numerical value,
> representing the angle of rotation, or a procedure that returns the angle of
> rotation. In one of the examples I used the function discussed earlier in
> this thread to have it automatically detect the angle of a beam. However, I
> can't manage to make this idea work when the procedure given to
> Hairpin.rotate requires more than one variable. This is very inconvenient
> because for some cases the procedure would need to calculate again a lot of
> things that are already calculated in the process of making the stencil.
First of all, calling ly:grob-property calls any procedure the
property is set to. The function ly:grob-property-data won't.
I don't know of any way in Scheme to overload functions or to count
arguments. If you name your function, however, you can use
procedure-name. (See the attached.)
HTH,
David
rotated hairpins.ly
Description: Text Data