lilypond-user
[Top][All Lists]
Advanced

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

Function definition


From: Jeremiah Reilly
Subject: Function definition
Date: Sun, 20 Feb 2022 15:26:27 +0100

I have a problem which I cannot figure out.

Lilypond has a built-in function to engrave guitar fingerings in a score.

The function works just fine, but is long and cumbersome to type, for example:

\rightHandFinger #2           (#2 = i = index finger)

which fingers the attached note with the index finger label 'i'.

I was able to follow the manual and create a shorthand for this function:

#(define RH rightHandFinger)

which works just fine, as illustrated with the following code  (see attached score):

#(define RH rightHandFinger)

\new Staff \with {
  instrumentName = "Example"
}

\relative c'
{
  \clef "treble_8"
  \key f \major
  \set strokeFingerOrientations = #'(up)
  a4\RH #2 c\RH #3 d\RH #2 e\RH #3  \bar "|." |
}


The code "\RH #2" is still more than I want to type.

I want to create a fingering-function  for the index finger as follows:

\RHi      (and similarly for all the fingerings i, m, a, and p).

Can this be done? Am I missing a concept here? I tried:

#(define RHi rightHandFinger #2)

but this did not work.

Jeremiah

Attachment: score2.jpg
Description: JPEG image


reply via email to

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