I andrew, thanks for your help!

Andrew Bernard wrote
> How is your Scheme coding skill?

Very low... but I'm learning!

Your exemple was a big help, especially because the order of appearence of
the elements in my function wasn't good and didn't allowed me to add a
variable in the original markup...

So now I can add all the parameters I wanted:

\version "2.19.81"

hook =
#(let ((direction? (lambda (n) (= 1 (abs n)))))
       (define-event-function (direction on-line lenght offset)
       (direction? boolean? number? pair?)
       (let* ((self-al (if on-line 0 0.31))
            (self-al (if (= direction 1) (- self-al) self-al))
            (hook-markup #{
              \markup \path #0.12 #`((moveto 0 0)
                                      (rlineto -0.85 0)
                                      (rlineto 0 ,lenght))
              #})
            )
       #{
         \tweak self-alignment-Y $self-al
         \tweak extra-offset #offset
         \tweak extra-spacing-width #'(-0.5 . 0)
         \finger \markup \scale #(cons 1 direction) #hook-markup
       #})))


\layout {
  \context {
    \Voice
    fingeringOrientations = #'(left)
  }
}

\relative {
  <e'\hook #DOWN ##t 3 #'(0.75 . 0)>4 <f\hook #DOWN ##f 6 #'(0.75 . 0)>
<f\hook #DOWN ##f 6 #'(0.75 . -1)>
}

I have two questions though:

1) As can see, the markup is centered aligned. If the lenght is higher, it
moves further from the note head. I can adjust it with my Y-offset command,
but I think there is a way to make it by default top aligned, no?

2) This solution adds a lot of numbers after the initial \hook command.
Isn't there a way to tell the function some default values for the "lenght"
and "offset" parameters I have added, and just tweak them if necessary in
the score?




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to