lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fingering


From: Thomas Morley
Subject: Re: fingering
Date: Wed, 21 Feb 2018 23:15:30 +0100

2018-02-21 9:29 GMT+01:00 Gianmaria Lari <address@hidden>:
>
> On 20 February 2018 at 22:30, Thomas Morley <address@hidden>
> wrote:
>>
>> 2018-02-20 18:42 GMT+01:00 Gianmaria Lari <address@hidden>:
>> > On 20 February 2018 at 17:10, Robin Bannister <address@hidden> wrote:
>> >>
>> >>  DJF wrote:
>> >>
>> >>>  perhaps someone else knows if it’s possible to control the vertical
>> >>> spacing within the staff;
>> >>
>> >>
>> >> You can splay it out using Y-offset:
>> >>  <d'-\tweak Y-offset 0.7 \4   b \3   g-\tweak Y-offset -0.9 -2 >1
>> >
>> >
>> > Do you know Robin, if there is any way to avoid the "\tweak ..." and
>> > make
>> > Lilypond automatically spacing the fingering/stringNumber elements?
>> >
>> > Thank you, g.
>>
>>
>>
>> How about:
>>
>> \version "2.19.81"
>>
>> circledFingerStil =
>>   #(lambda (grob)
>>      (circle-stencil (ly:text-interface::print grob) 0.1 0.1))
>>
>> \fixed c' {
>>   \set fingeringOrientations = #'(left)
>>
>>   <g-\tweak stencil \circledFingerStil -2
>>    b-\tweak stencil \circledFingerStil-3
>>    d'-4>1
>>
>>   \override Fingering.stencil = \circledFingerStil
>>   <g-2 b-3 d'-4>1
>> }
>>
>> There _is_ some buit-in code which avoids collisions of Fingering, but
>>  it does not work for StringNumbers or a mix of Fingerings and
>> StringNumbers, afaik.
>>
>> Cheers,
>>   Harm
>
>
> Ciao Harm,
> thanks a lot for your code! It works very well.
>
> But I also have some questions.
>
> The circled and uncircled fingering are not horizontally aligned. Is there
> any way to align them?
>
> Is there any way to make the more easy to manage? I can write something like
> this
>
>   <g-\tweak stencil \circledFingerStil -2
>    b-\tweak stencil \circledFingerStil-3
>    d'-4>1
>
> just to test an idea but I don't want to use it in a real score.
> Is there any way to reduce/encapsulate it to something less intrusive?
>
> Thank you!
> G.

Hi,

try:

\version "2.19.81"

%% returns a stencil (created by `ly:text-interface::print') within a circle
circledFingerStil =
  #(lambda (grob)
     (circle-stencil (ly:text-interface::print grob) 0.1 0.1))

%% tweak-short-cut
cFS =
  \tweak stencil \circledFingerStil
  \etc

adjustFC =
  \override Staff.FingeringColumn.before-line-breaking =
    #(lambda (grob)
       "Sets @code{snap-radius} of @code{FingeringColumn} to @code{3} and
        applies @code{centered-stencil} to every fingering-stencil"
       (let*  ((fingerings (ly:grob-object grob 'fingerings))
               (fingering-ls
                 (if (ly:grob-array? fingerings)
                     (ly:grob-array->list fingerings)
                     '())))
                     (write grob)
         (ly:grob-set-property! grob 'snap-radius 3)
         (for-each
           (lambda (f)
             (ly:grob-set-property! f 'stencil
               (centered-stencil ((ly:grob-property-data f 'stencil) f))))
           fingering-ls)))

{

  %% NB FingeringColumn is created _only_ if `fingeringOrientations' contains
  %% 'left or 'right _and_ more than one Fingering has to be placed there
  \set fingeringOrientations = #'(left)

  %% default
  <c'-1 d'-22 e'-333 f'-4444>1

  %% some circles around Fingerings
  <c'-1 d'\cFS-22 e'\cFS-333 f'-4444>1

  %% some circles around Fingerings plus adjusted FingeringColumn
  \once \adjustFC
  <c'-1 d'\cFS-22 e'\cFS-333 f'-4444>1
}

HTH,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]