lilypond-user
[Top][All Lists]
Advanced

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

Re: Strange output of \addFingering


From: Thomas Morley
Subject: Re: Strange output of \addFingering
Date: Thu, 2 Aug 2012 17:18:03 +0200

2012/8/2 address@hidden <address@hidden>:
> I'm using the scheme function \addFingering to add string numbers to a music
> part.
> Since my music is supposed to be played on a Pedal Steel Guitar I need some
> special string numbers.
>
> On the Pedal Steel Guitar there are 10 string (may be more or less, but this
> is standard)
> On a number of the strings there is a pedal that retune the string.
> So I need to be able to set string number to a value between 1 - 10 and also
> have a letter after the string number. E.g 5A
>
> The first part works perfectly in the \addFingering function but the second
> part. Well I get the letter but it's not the same size as the number!
>
> Why and how do I change the function so that it displays the letter (or
> letters) in the same size as the number.

You could call the function below in \melody
(I named it \xy. You may want to change this uninspired term.) :)

xy =
\override StringNumber #'before-line-breaking =
  #(lambda (grob)
    (let* ((txt (ly:grob-property grob 'text))
           (frst (string-take txt 1))
           (other (string-drop txt 1))
           (fsize (ly:grob-property grob 'font-size))
           (mrkp (markup (#:concat (frst #:fontsize (+ fsize 1.5) other)))))
    (ly:grob-set-property! grob 'text mrkp)))

file attached.

HTH,
  Harm

Attachment: TestStringNumber-rev.ly
Description: Binary data


reply via email to

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