[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guide finger
From: |
David Nalesnik |
Subject: |
Re: guide finger |
Date: |
Tue, 21 Aug 2012 20:45:08 -0500 |
Hi pabuhr,
On Tue, Aug 21, 2012 at 4:58 PM, pabuhr <address@hidden> wrote:
> I suppose you're thinking of ly:stencil-rotate.
>
> Brilliant!
>
> Now let me see if I can reward your patience by showing you I have learned
> something.
:)
>
> The rotation needs to be along the right centre (center) so the character
> appears to rotate in the middle of the finger number, which I figured out.
> Also, I put in some documentation. And I generalize one step further by
> allowing the ornamentation character to be passed as an argument. However, I
> don't know how to write "gsc" (see below) to pass in a character or unicode to
> "gx". So I still need help.
That was a puzzler :) Turns out, the markup command \char takes an
integer (seems obvious in retrospect...). You can see its definition
in the file `define-markup-commands.scm'. So you just need to change
the type predicate in gsc:
% guide slope character
gsc = #(define-music-function (parser location slope character
fingering) (number? integer? ly:music?)
(gx slope character fingering))
In order to pass the '+' character with \gsc you have to convert it to
an integer:
c4^\gsc #15 #(char->integer #\+) ^2
>
> Also, does scheme have optional positional parameters and/or named parameters
> to possibly allow more generalization, such as the padding size or putting the
> ornamentation before or after the finger symbol? (Yea, I'm probably getting
> carried away here. ;-)
Well, you could easily pass the direction in (and whatever else) by
adding another argument. You could use conditionals within the
function--do this if the direction is -1, etc. (You might also be
able to use the direction as a multiplier.) If you decide exactly
what extras you want with the function, I'll be glad to help!
Best,
David