Search code examples
lilypond

Notating simultaneous upbeat and grace notes in LilyPond


I would like to transcribe Schumann's Kreisleriana, Op16-7 in LilyPond, but I don't know the source code to reproduce the red-circled part in the attached image. I would like to know the LilyPond source code for the part in question, or if anyone knows the structure of the notes. Thank you in advance.

enter image description here

Note: I am Japanese, and this text is translated from Japanese using DeepL because I am not familiar with English.

--Version and language of LilyPond--

version: 2.24.3

language: english

Try.

1. If you consider that the 16th note of G and the 32nd triplet (grace note) overlap

1-1. When "<<>>" is used

Source code:

\version "2.24.3"
\language "english"

global = {
    \time 2/4
    \tempo "Sehr rasch" 4 = 144
    \key c \minor
    \numericTimeSignature
}

right = \relative c'' {
    \global
    \clef treble
    << { \stemUp g16 } { \grace { \stemDown g32 c d } } >> 
}


left = \relative c {
    \global
    \clef bass
    r16
}

\score {
  \context PianoStaff <<
    \new Staff {
      \right
    }
    \new Staff {
      \left
    }
  >>
  \layout {
    \override Score.Clef.break-visibility = #all-invisible
    \override Score.KeySignature.break-visibility = #all-invisible
    \override Score.SystemStartBar.collapse-height = #1
  }
  \midi {}
}

Output:

enter image description here

1-2. When described as is

In the above source code, change only "right" as follows.

Source code (Corrected part only):

right = \relative c'' {
    \global
    \clef treble
    \stemUp g16 \grace { \stemDown g32 c d } 
}

Output:

enter image description here

In the above attempt, I thought that the 16th note of G and the 32nd triplet (grace note) overlapped, but it did not work. (I doubt if the main note and the ornamental note ever overlap in the first place...) Perhaps there is an error in both the musical interpretation and the source code description. I have no knowledge of music, and I am new to LilyPond, so this is what I get. I have been browsing the official documentation and websites about LilyPond and music, but have not been able to solve the problem. Please help me!


Solution

  • Here is one way you could do it:

    \version "2.24.3"
    \language "english"
    
    global = {
        \time 2/4
        \tempo "Sehr rasch" 4 = 144
        \key c \minor
        \numericTimeSignature
    }
    
    right = \relative c'' {
        \global
        \clef treble
        \partial 16
        << 
          { g16 } 
          \\ 
          { \magnifyMusic #2/3 { \omit TupletNumber \tuplet 3/2 { g32 c d } } }
        >> 
        ef16( fs, c' ef)
    }
    
    
    left = \relative c {
        \global
        \clef bass
        \partial 16
        r16
        <g c a'>8->\arpeggio r
    }
    
    \score {
      \context PianoStaff <<
        \new Staff {
          \right
        }
        \new Staff {
          \left
        }
      >>
      \layout {
        \override Score.Clef.break-visibility = #all-invisible
        \override Score.KeySignature.break-visibility = #all-invisible
        \override Score.SystemStartBar.collapse-height = #1
      }
      \midi {}
    }
    

    What happening here is we notice that the grace notes are actually measured pickup notes (partial measure) and that they should be aligned with the 16th rest in the left hand. These pickup notes are triplets but without the triplet number and smaller, so we magnify the music by 2/3 (that is, shrink it). Also, the structure for simultaneous notes is << { } \\ { } >>. Notice the two backslashes in the middle. (That's an oversimplification, see https://lilypond.org/doc/v2.24/Documentation/notation/multiple-voices)

    It's a lot to take in for a beginner, but there it is.