4

I am trying to engrave a pipa piece using Lilypond 2.20 on Ubuntu 20.04. The first several notes render like this:

enter image description here

What do not look right:

  1. Clef in the lower part does not start with a bass symbol, but the bass appeared after it.
  2. The customized time signature symbol サ does not appear in the lower staff. Instead a big C.
  3. The whole first section should be cadenza (both upper and lower part), but the bar line still appear in the lower part.

Any help will be highly appreciated!

Here is my Lilypond source code:

\version "2.20.0"

\header {
  title = "Yi Dance"
  subtitle = "彝族舞曲"
  subsubtitle = "1960"
  instrument = "Pipa · 琵琶"
  composer = "WANG Huiran · 王惠然"
  arranger = "Pipa Fingering: YANG Wei · 楊惟"
}

\markup {
  \vspace #1
}

%% fingering symbols

fngs = \finger\markup{\override #'(font-name . "pipa") \fontsize #5 "s"}
fngw = \finger\markup{\override #'(font-name . "pipa") \fontsize #5 "w"}

fngDaiLunBoxed = ^\markup{\translate #'(-2.25 . 1.25) \box{\pad-markup #0.2 \override #'(font-name . "pipa") \fontsize #2 "s w"}}

\layout {
  indent = #0
  \context {
    \Score
    \remove "Bar_number_engraver"
  }
  \context {
    \Voice
    \consists "Melody_engraver"
    \override Stem #'neutral-direction = #'()
  }
}

global = {
  \key a \minor
  \numericTimeSignature
}

upper = \relative c'' {
  \clef treble
  \global
  % Music follows here.
 
  %% for the symbol サ  
  \once\override Staff.TimeSignature.stencil = #ly:text-interface::print
  \once\override Staff.TimeSignature.text = \markup{\bold \fontsize #3 "サ" }
  \once\override Staff.TimeSignature.extra-offset = #'(0 . -1.5)
  
  %% section title and tempo hint
  \once \override Score.RehearsalMark.self-alignment-X = #LEFT
  \tempo "[1] liberamente, lento poi accelerando【一】自由地、慢起漸快"
  \cadenzaOn
    \appoggiatura{d16 c} a4\fngDaiLunBoxed \appoggiatura{d16 c} a4 \appoggiatura{d16 c} a4  \appoggiatura{d16 c} a4 
  \cadenzaOff
  \revert Score.TimeSignature.stencil
   
  
}

lower = \relative c {
  \clef bass
  \global
  % Music follows here.
  
  %% for the symbol サ  
  \once\override Staff.TimeSignature.stencil = #ly:text-interface::print
  \once\override Staff.TimeSignature.text = \markup{\bold \fontsize #3 "サ" }
  \once\override Staff.TimeSignature.extra-offset = #'(0 . -1.5)
  
  \cadenzaOn
    c1 c
  \cadenzaOff
  \revert Score.TimeSignature.stencil
 
}

\score {
  \new PianoStaff   
  <<  
  \new Staff = "upper" \upper  
  \new Staff = "lower" \lower
  >>  
  
  \layout { }
  \midi { }
}

1 Answer 1

6

Here's what you can do about it:

  1. That is caused by the grace notes. They always come in before the beat, so the program behaves according to this logic: "Let's start the two staves. OK, the top one has to have a treble clef, and the other has no clef specified yet, so let's put a treble clef in it too. Now put some grace notes in the top staff and a bit of empty space in the bottom staff. Hey! There is a bass clef in the bottom staff now! Let's render it!" etc. If you put a \grace s8 after your \clef bass, the musics will "line up" and the problem goes away.

  2. In the PianoStaff, the time signatures are bound together: you change it in one staff, it changes in the other one too.* I'm not exactly sure how this works, but if you apply your サ hack to PianoStaff.TimeSignature instead of Staff.TimeSignature, it will start doing what you want.

  3. Ditto for cadenzas. If you start/stop cadenza in one staff, it gets automatically started/stopped in the other.* So in your example, the music in the first staff ends earlier and the cadenza is stopped, so the cadenza is stopped in the other staff too, which results in a barline (and in a 4/4 time) after that. This will go away by itself as you will write the music.

(*: Experimentally established fact 😃)

I would also recommend a couple of little changes to make the code a bit cleaner. They don't change the output at all:

  • It would be cleaner to put your time signature overrides into your global variable. It's the best place to dump all such overrides into.

  • You don't need to \revert the time signature hack because it was overridden only \once, i. e. it works only for the next one occurrence of that object, in this case time signature.

  • I would also move the \layout block into the \score block for an extra bit of cleanliness.

6
  • Hi Ramillies, you are truly the prettiest lily in the pond! Thank you very much! I followed your suggestion and now my score looks like this: photos.app.goo.gl/YhC6LRVhpTywkxBb9 Very happy with the fixes! :-) Thanks thanks! Nov 8, 2020 at 14:43
  • I just asked yet another question (2 questions in one post actually)....But I love lilypond, there are endless possibilities. Nov 8, 2020 at 14:45
  • What does the s8 in \grace s8 mean? Nov 8, 2020 at 18:01
  • 1
    s is a spacer rest — just an invisible rest which takes the given amount of time, in this case, 8 = 1/8 note.
    – Ramillies
    Nov 8, 2020 at 18:16
  • This is the result of today's engraving work.... photos.app.goo.gl/KKCS8WRNF5vpWcrP9 this was not easy, so many special things, had to dig into the docs.... But it's worthwhile for this beautiful piece. Yi Dance was arranged on classical guitar too. Even on a classical guitar, it is a very difficult piece. youtu.be/tjHcHlIEy14 I'll resume the engraving work later. Thanks again for your help! Wish you a nice evening and a great week ahead! Nov 8, 2020 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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