8

Can lilypond generate this (see attached image), connect the beam on every other note - use voices? It also has slurs between the 'voices.'

two voices of interleaved (alternating) sixteenth notes

7
  • LilyPond can definitely generate multiple voices. See, for example, LilyPond Manual: 1.5.2 — Multiple Voices.
    – Aaron
    Dec 19, 2022 at 7:30
  • 4
    Sorry if this is a dumb question, but… What does that notation mean? How can you slur notes that are simultaneous? (Or if they're not simultaneous, isn't that an abuse of notation?)
    – gidds
    Dec 19, 2022 at 18:44
  • 1
    @gidds Not a violinist, but I'd guess that the O notes are played on the open E string and the other notes are played on other strings. Thus those "other string" notes can be slurred/tied on to the notes played on the E string. Dec 20, 2022 at 12:37
  • @AndrewLeach Yes, the two voices are clearly to be played on different strings. But I still find the notation highly confusing. Are the two voices to be played simultaneously (using double-stopping), or alternately? If simultaneously, then the slurs/ties are misleading, and I'd suggest best omitted; if alternately, then there are missing rests and/or wrong note values, or the voice-splitting/tail-barring is wrong/misleading.
    – gidds
    Dec 20, 2022 at 22:41
  • 1
    It is from the 2nd movement (Allegro) of Violin Sonata in F major, HWV 370 by George Frideric Handel. As @AndrewLeach pointed out, each 16th note is played separately but on alternating A and E strings. The slurs indicate bowing (each slurred note pair is played in one bow, either up or down). So it goes, "c on A string downbow," "e open E string downbow," "e on A string upbow," "e open E string upbow," "b on A string downbow," "e open E string downbow," and so on.
    – scanudom
    Dec 20, 2022 at 23:54

3 Answers 3

9

It's a bit complicated to get the slurs to look like they are going between the two voices and the beams to jump over one another, but you only need two voices for this: one with some spacers and the other with hidden notes.

\version "2.23.6"

\score {
    <<
        \new Staff {
            \key f \major
            << 
                {
                    \repeat unfold 4 {
                        s16 e''-0[ s e''-0]
                    } | 
                }
                \\
                {
                    c''16[^(\< \once\hideNotes e'') e''-4]( \once\hideNotes e'')
                    b'[^( \once\hideNotes e'') e'']( \once\hideNotes e'')\!
                    c''[^( \once\hideNotes e'')\> e'']( \once\hideNotes e'')
                    b'[^( \once\hideNotes e'') e'']( \once\hideNotes e'')\! |
                }
            >>
        }
    >>
}

result of above code


Update:

If you look closely at the above image you'll notice that the slurs between the third and fourth notes in each set aren't close enough to the fourth note. This is because the slur is avoiding bumping into the fourth note's (hidden) downward stem.

Perhaps the easiest way to fix this is to use \omit Stem & \omit Flag as in your answer (rather than \hideNotes).

As suggested in @ksnortum's comment, a macro can be used to simplify the code:

oosf = { 
    \once \omit Stem
    \once \omit Flag
}

The lower voice can now be written as:

...
                {
                    c''16[^(\< \oosf e'') e''-4]( \oosf e'')
                    b'[^( \oosf e'') e'']( \oosf e'')\!
                    c''[^( \oosf e'')\> e'']( \oosf e'')
                    b'[^( \oosf e'') e'']( \oosf e'')\! |
                }
...

which will give:

result of code with updates, showing symmetric slurs between the third and fourth note of each set

2
  • 2
    I find that if I'm using \once\hidenotes a lot, I shorten it with ohn = \once \hideNotes.
    – ksnortum
    Dec 19, 2022 at 15:36
  • @Elements Very nice clean solution!
    – scanudom
    Dec 21, 2022 at 0:30
4

Though this may not be the most elegant way, the following worked.

\score {
    \relative c''
    \new Staff {
        \key f \major
        <<
            \new Voice {
                \voiceOne
                s16\< e-0[ s e-0]
                s e-0[ s e-0]\!
                s e-0[\> s e-0]
                s e-0[ s\! e-0]
            }
            \new Voice {
                \voiceTwo
                c16[ s e-4] s
                b[ s e] s
                c[ s e] s
                b[ s e] s
            }
            \new Voice {
                \voiceThree
                \override NoteColumn.ignore-collision = ##t
                \omit Stem
                \omit Flag
                \omit Beam
                \slurNeutral
                s16 s e( e)
                s s e( e)
                s s e( e)
                s s e( e)
            }
            \new Voice {
                \voiceFour
                \override NoteColumn.ignore-collision = ##t
                \omit Stem
                \omit Flag
                \omit Beam
                \slurNeutral
                c16( e) s s
                b( e) s s
                c( e) s s
                b( e) s s
            }
        >>
    }
}

enter image description here

3

Aaaand a different idea to expand on:

\layout {
  \context {
    \Staff
    \denies "Voice"
    \accepts "SuperVoice"
    \defaultchild "SuperVoice"
    }
  \context {
    \name "SuperVoice"
    \type "Engraver_group"
    \accepts "Voice"
    \consists "Slur_engraver"
    \consists "Dynamic_engraver"
    \consists "Dynamic_align_engraver"
    \defaultchild "Voice"
  }
  \context {
    \Voice
    \remove "Slur_engraver"
    \remove "Dynamic_engraver"
    \remove "Dynamic_align_engraver"
  }
}


{
  \key d \minor
  \new SuperVoice
  \voices 2,1
  <<
    \new Voice \with \voiceTwo
    { c''16[(\< s e''-4]( s b'[( s e'']( s c''[( s e'']( s b'[( s e''](\! s }
    \new Voice \with \voiceOne
    { s16 e''-0[) s e''-0]) s e''-0[) s e''-0])\!
      s e''-0[)\> s e''-0]) s e''-0[) s e''-0])  }
  >>
}

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.