Optionnal finger indication

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Optionnal finger indication

Jean-Julien Fleck
Hi everyone,

I have been searching how to indicate some optionnal finger indication in parenthesis but found no direct way. I ended up using some quite complicated hack:

doigte = \markup { \halign #-0.5 \override #'(font-encoding . fetaText)  \magnify #0.5 (4)}

and then {re-0-\doigte}.
It worked not so bad on the main score of the instrument but when I try to use the same code in smaller size to get the piano part with a construct like     

\new Staff \with {
          \magnifyStaff #5/7
              } { ... }

it does not adapt using the same reduction factor.
I've gathered an example on http://lilybin.com/lm06kb/1
with the finger indication occurence on third time of the second bar. As you can see, it's too big compared to the rest over the piano staff.

Any advice welcome on how to add parenthesis to the finger indication in a way that would be easily reduced on the piano part.

Cheers,

--
JJ Fleck
Physique et Informatique
PCSI1 Lycée Kléber

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Optionnal finger indication

Thomas Morley-2
Am Sa., 20. Okt. 2018 um 23:11 Uhr schrieb Jean-Julien Fleck
<[hidden email]>:

>
> Hi everyone,
>
> I have been searching how to indicate some optionnal finger indication in parenthesis but found no direct way. I ended up using some quite complicated hack:
>
> doigte = \markup { \halign #-0.5 \override #'(font-encoding . fetaText)  \magnify #0.5 (4)}
>
> and then {re-0-\doigte}.
> It worked not so bad on the main score of the instrument but when I try to use the same code in smaller size to get the piano part with a construct like
>
> \new Staff \with {
>           \magnifyStaff #5/7
>               } { ... }
>
> it does not adapt using the same reduction factor.
> I've gathered an example on http://lilybin.com/lm06kb/1
> with the finger indication occurence on third time of the second bar. As you can see, it's too big compared to the rest over the piano staff.
>
> Any advice welcome on how to add parenthesis to the finger indication in a way that would be easily reduced on the piano part.
>
> Cheers,
>
> --
> JJ Fleck

Use \fontsize instead of \magnify.
Also, use either \fontsize #(magnification->font-size 0.5), if you
really want to keep the numerical value for some reason.
Though, (magnification->font-size 0.5) evaluates to -6.0. Thus
\fontsize #-6.0 would do the trick as well.

Btw, no reason to use \override #'(font-encoding . fetaText) here.
\number is does the same and is shorter.
For aligning I'd use \center-align in \markup and a tweak for
parent-alignment-X.
Furthermore I think the parens are little too tall. I made them smaller.

\version "2.19.82"

doigte =
  -\tweak parent-alignment-X #CENTER
  -\markup {
        \center-align
        \number
        \fontsize #-6.0
        %"(4)"
        \concat {
          \fontsize #-2 "("
          "4"
          \fontsize #-2 ")"
        }
  }


\new Staff \with { \magnifyStaff 1 }
{ c''1^1-\doigte  }

\new Staff \with { \magnifyStaff #5/7 }
{ c''1^1-\doigte }

\new Staff \with { \magnifyStaff 2 }
{ c''1^1-\doigte }


HTH,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Optionnal finger indication

Jean-Julien Fleck
Thanks a lot Harm, it works perfectly !

Cheers,
 
Use \fontsize instead of \magnify.
Also, use either \fontsize #(magnification->font-size 0.5), if you
really want to keep the numerical value for some reason.
Though, (magnification->font-size 0.5) evaluates to -6.0. Thus
\fontsize #-6.0 would do the trick as well.

Btw, no reason to use \override #'(font-encoding . fetaText) here.
\number is does the same and is shorter.
For aligning I'd use \center-align in \markup and a tweak for
parent-alignment-X.
Furthermore I think the parens are little too tall. I made them smaller.

\version "2.19.82"

doigte =
  -\tweak parent-alignment-X #CENTER
  -\markup {
        \center-align
        \number
        \fontsize #-6.0
        %"(4)"
        \concat {
          \fontsize #-2 "("
          "4"
          \fontsize #-2 ")"
        }
  }


\new Staff \with { \magnifyStaff 1 }
{ c''1^1-\doigte  }

\new Staff \with { \magnifyStaff #5/7 }
{ c''1^1-\doigte }

\new Staff \with { \magnifyStaff 2 }
{ c''1^1-\doigte }


HTH,
  Harm


--
JJ Fleck
Physique et Informatique
PCSI1 Lycée Kléber

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Optionnal finger indication

Thomas Morley-2
Am So., 21. Okt. 2018 um 09:27 Uhr schrieb Jean-Julien Fleck
<[hidden email]>:
>
> Thanks a lot Harm, it works perfectly !

A further thought:
Currently the code will return TextScript not Fingering. Thus we need
to mimic aligning/fontsize like Fingering and loose the possibility to
apply Fingering-overrides/tweaks and fingeringOrientations.

Below a code which will return proper Fingering. It may be called
directly or predefined for certain finger.

\version "2.19.82"

parDoigt =
#(define-event-function (doigt)(ly:music?)
  (if (music-is-of-type? doigt 'fingering-event)
      #{
        -\tweak text
                \markup {
                  \number
                  \concat {
                    \fontsize #-2 "("
                    $(number->string (ly:music-property doigt 'digit))
                    \fontsize #-2 ")"
                  }
                }
        $doigt
      #}
      doigt))


%% predefined using ""
"(1)" = \parDoigt -1
"(2)" = \parDoigt -2
"(3)" = \parDoigt -3
"(4)" = \parDoigt -4
"(5)" = \parDoigt -5

%% predefined using unicode-signs
⑴ = \parDoigt -1

%% predefined using superscript
par¹ = \parDoigt -1


{
  %% direct call
  c''-1\parDoigt -1

  c''-1\"(1)"
  c''-1\"(2)"
  c''-1\"(3)"
  c''-1\"(4)"

  c''-1\par¹

  c''-1\⑴

  \set fingeringOrientations = #'(left)
  <
   c'-1^\"(2)"_\"(1)"
   e'-2^\"(3)"_\"(3)"
   g'-3^\"(4)"_\"(5)"
  >
}

Cheers,
  Harm

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