5

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>4\sA\startTextSpan <gis-1>8. <b-3>16\stopTextSpan | <a-1>8\rw r16 d16-4\rw <cis-3>16\rq <b-2>\rw <a-1>\rq <g-3>\rw |
  <fis-2>4\startTextSpan <eis-1>8. <g-3>16\stopTextSpan | <fis-1>8\rw r16 <a-4>16\rw <g-2>16\rq <fis-1>\rw <e-4>\sE\rq <d-1>\rw |

It looks like this: enter image description here

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

(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:

2

I came up with this solution:

startLun = \startTextSpan
stopLun = \grace s16\stopTextSpan
...
global = {
    ...
    \override TextSpanner.bound-details.left.text = \markup{\override #'(font-name . "pipa") \fontsize #2 "a"}
    ...
}

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

It renders like this: enter image description here

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?

3
  • 1
    This is actually not so much of a hack, I would say, but a nice answer! You could add \override TextSpanner.dash-fraction = 0.5 and \override TextSpanner.dash-period = 1 to render narrower dashes. It is also possible to shift the character on the left down a bit (which will eventually shift the dashed line a bit to the top) with \markup{\raise #-.5 {...}}. Nov 12 '20 at 13:29
  • @Jasper Habicht Thank you very much for your suggestion, this works like a charm! The ideal raise value for me is -1.2, looks really pretty! Thanks! Nov 12 '20 at 16:16
  • I added an answer to your other question where you ask specifically how to change the dash pattern. I also found a better way to center the text vertically. Nov 13 '20 at 6:01
0

You can avoid the dashes with

\override TextSpanner.style = #'none

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.