3

I have this simple code:

\new StaffGroup <<                                                                  
  \new Staff \with {                                                                
    instrumentName = "Vocal"                                                        
    shortInstrumentName = "Voc"                                                     
  } \new Voice = "voice" \relative {                                                
    a4 b c d                                                                        
  }                                                                                 
                                                                                    
  \new Lyrics \lyricsto "voice" {                                                   
    \lyricmode { A B C D }                                                          
  }                                                                                 
>>  

As expected it produces the following:

enter image description here

But the moment I add a grace note at the beginning:

\version "2.24.0"                                                                
\header {                                                                        
  title = "Jara si dil me de jagah"                                              
  composer = "Pritam"                                                            
}                                                                                
                                                                                 
\score {                                                                         
  <<                                                                             
    \time 4/4                                                                    
    \tempo 4 = 82                                                                
    \new StaffGroup <<                                                           
      \new Staff \with {                                                         
        instrumentName = "Vocal"                                                 
        shortInstrumentName = "Voc"                                              
      } \new Voice = "voice" \relative {                                         
        %\grace {s16}                                                             
        \grace {g16} a4 b c d                                                    
      }                                                                          
                                                                                 
      \new Lyrics \lyricsto "voice" {                                            
        \lyricmode { A B C D }                                                   
      }                                                                          
    >>                                                                           
  >>                                                                             
                                                                                 
  \layout {                                                                      
  }                                                                              
                                                                                 
  \midi {                                                                        
  }                                                                              
}    

this happens: enter image description here

There is a spurious "C" symbol. How can I fix this?

7
  • 2
    Does this answer your question? Errors with slashed grace notes in LilyPond Mar 30, 2023 at 3:53
  • Tried adding a grace s16. Didn't work.
    – kargirwar
    Mar 30, 2023 at 4:09
  • Oh, then can you please edit your question to show the other staffs/voices. Because without them second code block doesn't exhibit the bug. (the code blocks don't match the images) Mar 30, 2023 at 4:15
  • I have only one staff. Using lilypond 2.24.0 on Mac.
    – kargirwar
    Mar 30, 2023 at 4:28
  • Added full code.
    – kargirwar
    Mar 30, 2023 at 4:35

1 Answer 1

4

Move the \time and \tempo commands inside the \new Voice block, like this:

...
\new Voice = "voice" \relative { 
    \time 4/4                                                                    
    \tempo 4 = 82                                                          
    \grace {g16} a4 b c d                                                    
}
...

This will prevent the extra staff from being created, and hence avoid the issue 34 bug from happening.

0

Your Answer

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

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