lilypond

Lilypond, add stroke through stem


I'm trying to typeset this music:

enter image description here

I can get close with this, but I would really like the stroke through the dotted-quarter in the tuplets.

\relative{                                                                      
  \clef bass                                                                    
  \key f \major                                                                 
  \numericTimeSignature                                                         
  \time 2/2                                                                     
  \tempo "Animato assai." % 2 = 110                                             
                                                                                
  \mark 7                                                                       
                                                                                
  a,,8\ff r8                                                                    
  a'8     r8                                                                    
  \tuplet 3/2 { a8[ a a ] }                                                     
  a8 r8 |                                                                       
                                                                                
  d,1-> |                                                                       
                                                                                
  %            V~~~ Can I put a strike through this stem?                       
  \tuplet 3/2 {a'4.} a8 r8                                                      
  \tuplet 3/2 { a8 [ a8 a8 ] } a8 r8 |                                          
  %             ^~~~  Or can I collapse these?                                  
                                                                                
  d,1-> |
} 

Which gives me:

enter image description here

I've tried setting the Flag.stroke-style, but that just puts a stroke through 8ths that already have flags.

\override Flag.stroke-style = #"grace"

Solution

  • Try looking up \repeat tremolo. I'm not at my computer so I can't test it, sorry.


    Update:

    Tremolo is the magic word that's missing here. It actually has nothing to do with tuplets.

    \repeat tremolo x c'y means: Repeat c'y x times. In this case, we want \repeat tremolo 3 a'8 for three eights.

    A short-hand form is c'x:y where x is the total duration and y is the length of a single note. In this case: a'4.:8 will give us eights until a dotted-quarter has elapsed.

    Here's the updated code:

    \relative{                                                                      
      \clef bass                                                                    
      \key f \major                                                                 
      \numericTimeSignature                                                         
      \time 2/2                                                                     
      \tempo "Animato assai."                                             
                                                                                    
      \mark 7                                                                       
                                                                                    
      a,,8\ff r8                                                                    
      a'8     r8                                                                    
      \tuplet 3/2 { a8[ a a ] }                                                     
      a8 r8 |                                                                       
                                                                                    
      d,1-> |                                                                       
                                                                                    
      %            V~~~ Short-hand for "repeat tremolo 8ths until 4. has elapsed                       
      \tuplet 3/2 {a'4.:8} a8 r8                                                      
      \tuplet 3/2 {\tremolo repeat 3 a8 } a8 r8 |                                          
      %             ^~~~  Or "repeat 3 8ths in a tremolo"                               
                                                                                    
      d,1-> |
    } 
    

    That gives this:

    enter image description here