Hello,

On Sun, Aug 19, 2012 at 2:04 PM, pabuhr <pab...@fastmail.fm> wrote:
> In *classical* guitar-music, there is a finger augmentation called a "guide
> finger" indicating left-hand shifting. Nick Payne uses a mechanism based on 
> the
> glissando.
>
> I found this code written for a finger shift on a violin, which I like because
> it handles finger location and color, etc. However, for guitar, there are 3
> kinds of finger shift: up, neutral and down, corresponding to about 30 degrees
> up, flat and 30 degrees down for the "-" character.
>
> So I can't make the changes to do what I want. 8-( I have sketched out what I
> would like, which is 2 default parameters, the guide character and the 
> rotation
> amount, and to rotate this character before concatenating it with the string
> number.
>
> Any help would be greatly appreciated.

With 2.14.2, I come up with the code below.  I've added a function
which lets you specify the angle.

You might consider upgrading to one of the current development
versions if you're interested in writing functions like this.  There
is now quite a bit more flexibility and power to music functions
(thanks to David Kastrup).

HTH,
David

%%%%%%%%%%%%%%%%%%

\version "2.14.2"

#(define (gx rotate-guide fingering)
  (let ((music (make-music 'FingeringEvent))
        (finger (ly:music-property fingering 'digit))
        (guide-char #x2013))
    (set! (ly:music-property music 'tweaks)
          (acons 'stencil
                 (lambda (grob)
                   (grob-interpret-markup grob
                                          (make-concat-markup
                                           (list
                                            (make-rotate-markup rotate-guide 
(make-char-markup guide-char))
                                            (number->string finger)))))
                 (ly:music-property music 'tweaks)))
    music))

gn = #(define-music-function (parser location fingering) (ly:music?)
(gx 0 fingering))
gu = #(define-music-function (parser location fingering) (ly:music?)
(gx 30 fingering))
gd = #(define-music-function (parser location fingering) (ly:music?)
(gx -30 fingering))

% BONUS!
ggg = #(define-music-function (parser location slope fingering)
(number? ly:music?) (gx slope fingering))

\relative c' {
  \override Fingering #'color = #red
  \set fingeringOrientations = #'(left)
  <c-\gn-3 >4
  c4^\gn^3
  c4-\gn-3
  c4_\gn_3
  \set fingeringOrientations = #'(right)
  <c-\gn-3>4

  <c-\gu-3>4
  c4^\gu^3
  c4-\gd-3
  c4_\gd_3

  <c-\ggg #-15 -3>4
  c4^\ggg #15 ^3
  c4-\ggg #45 -3
  c4_\ggg #-45 _3
}

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

Reply via email to