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 at 3:53
  • Tried adding a grace s16. Didn't work.
    – kargirwar
    Mar 30 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 at 4:15
  • I have only one staff. Using lilypond 2.24.0 on Mac.
    – kargirwar
    Mar 30 at 4:28
  • Added full code.
    – kargirwar
    Mar 30 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.

3
  • Should it be moved to the \new voice block or the \new staff block? I thought that in a staff group, the \time should go with the first \new and then was inherited by subsequent blocks unless otherwise indicated.
    – Aaron
    Mar 30 at 5:02
  • @Aaron if you try that, the bug will stay and you'll get two extra staffs. Mar 30 at 5:21
  • Ahh. I see my mistake. I had deleted the \tempo line.
    – Aaron
    Mar 30 at 5:32

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.