bell notificationshomepageloginNewPostedit profiledmBox

Hoots : How to create a spanner for a fingering in lilypond I'm engraving scores for pipa, a sibling instrument of classical guitar (Pipa and guitar do have the same ancestor from central Asia). One of the most common right-hand - freshhoot.com

10% popularity   0 Reactions

How to create a spanner for a fingering in lilypond
I'm engraving scores for pipa, a sibling instrument of classical guitar (Pipa and guitar do have the same ancestor from central Asia).
One of the most common right-hand fingering on pipa is called Lunzhi, literally "rotating fingers". You basically kick your fingers of your right hand against the strings, start from index finger, one finger after another, and rotate from the index finger when the thumb has also done its job. The sound texture is much like the tremolo on a classical guitar.
The symbol for Lunzhi is like a pretty flower. However it can go on and on, so I need a spanner for this. At the moment I am faking it with Lilypond's TextSpanner. It looks ok. However I don't what to see startTextSpanner and stopTextSpanner everywhere in my source code. It is semantically incorrect. This is a fingering spanner, not a text spanner. I want something like startLun and stopLun in my Lilypond code. How to do it? Many thanks in advance!
This is what I am already using:
override TextSpanner.bound-details.left.text = markup{override #'(font-name . "pipa") fontsize #2 "a"}
...
<a-2>4sAstartTextSpan <gis-1>8. <b-3>16stopTextSpan | <a-1>8rw r16 d16-4rw <cis-3>16rq <b-2>rw <a-1>rq <g-3>rw |
<fis-2>4startTextSpan <eis-1>8. <g-3>16stopTextSpan | <fis-1>8rw r16 <a-4>16rw <g-2>16rq <fis-1>rw <e-4>sErq <d-1>rw |

It looks like this:

I'm not totally happy with the dashed line though. I'd like the dashed line to look more like this:

(The dashed line above does not span, it is a single character in the pipa font.)
Thanks in advance!
Here is the classical guitar piece Recuerdos de la Alhambra played on a pipa, you get the idea of the power of Lunzhi:


Load Full (1)

Login to follow hoots

1 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

I came up with this solution:
startLun = startTextSpan
stopLun = grace s16stopTextSpan
...
global = {
...
override TextSpanner.bound-details.left.text = markup{override #'(font-name . "pipa") fontsize #2 "a"}
...
}

pipa = relative c'' {
global
% Music follows here.
<fis-1>4startLun a8.-2 stopLun c16-4rw | c4startLun stopLun b8-3rw r8 |
...
}
...

It renders like this:

Still this is a hack based on text spanner, but at least in the source code I created an API which communicates the nature of this text span. It is a bit cleaner than text spanner everywhere.
Any idea about how to modify the style of the dashed lines?


Back to top Use Dark theme