7

I want to put a note to be played by the left hand on the treble clef - using LilyPond.

How can this be done?

What I want to achieve is like this: Left Hand Note Going on the Treble Clef

This is how my code looks right now:

Right Hand:

\repeat volta 2 {
    \time 4/4 
    <<c1-1 e1-3>> |<<c1 e1>> |<<c1 e1>> | <<c1 e1>>
}

Left Hand:

 \repeat volta 2 {
    r4 g'4-._2 g,2 | r4 g'4-.  g,2 | r4 g'4-. g,4 g4 | r1
}

This is giving me something like this:

Left Hand Note With Ledger Lines

3
  • Normally three leger lines above bass clef really shouldn't be a problem for a pianist to read, (but I understand this is probably just a simplified example) Commented Nov 27, 2021 at 15:32
  • 1
    @ElementsinSpace the left hand G4 isn't hard to read because of the ledger lines; if the right hand part were an octave higher it would be completely normal. It's a bit odd to have the G4 represented at a lower position on the page than the C4 and E4, however, and putting it on the upper staff is a reasonable way to fix that.
    – phoog
    Commented Nov 27, 2021 at 18:33
  • @phoog yeah good point, that does make sense. Commented Nov 27, 2021 at 20:49

1 Answer 1

6

What you are looking for is \change Staff. (See Changing staff manually)

Basically you just tell LilyPond to \change Staff and give the name of the staff you want to change to, but first you need to give the staves names (such as "up" and "down").

You should get something like this:

Code:

\new PianoStaff <<
    \new Staff = "up" {
        \time 4/4 \numericTimeSignature
        \repeat volta 2 {
            <c' e'>1-1-3 |
            \repeat unfold 3 {
                <c' e'>1 |
            }
        }
    }
    \new Staff = "down" {
        \time 4/4 \numericTimeSignature
        \clef bass
            \repeat volta 2 {
                \stemDown
                \showStaffSwitch
                r4 
                    \change Staff = "up"
                    g'4-._2_\markup{\italic"L.H."}
                    \change Staff = "down"  
                    g2_5 | 
                \hideStaffSwitch
                r4 
                    \change Staff = "up"
                    g'4-.
                    \change Staff = "down"  
                    g2 | 
                r4 
                    \change Staff = "up"
                    g'4-.
                    \change Staff = "down"
                    g4 g4 | 
                \stemNeutral
                R1 |
            }
    }
>>

Image:

rendering of above code

Notes:

  • As well as writing "L.H." I used \showStaffSwitch which draws lines showing that where the voice in moving across staves. And turned this off (after it is clear what is going on) with \hideStaffSwitch.

  • I used \stemDown to get the left hand note stems in the treble clef to go down. After the staff changes I used \stemNeutral to get them going in the default direction once more.

  • I've simplified your chord notation, (you only need a single pair of chevrons < > for a chord).

  • I also collapsed the repeated chords in the right hand (with a \repeat unfold), to save typing.

  • I've used absolute note names (rather than relative note names), because they make much more sense to me, but this is not necessary at all.

  • I used R1 instead of r1 for a full bar rest, so that it is centred in the bar.

  • Maybe you want the automatic version \autoChange (documentation can be found the same page of the link above).

5
  • 1
    Related solution involving \autoChange: How to have one voice in multiple staves with lilypond?.
    – Aaron
    Commented Nov 27, 2021 at 18:14
  • 1
    It seems to me that L. H. ought to be above the staff; is there a reason to put it in the middle like that (other than that that's what the OP asks for)?
    – phoog
    Commented Nov 27, 2021 at 18:35
  • @phoog Good point, it does indeed look rather hideous with the markup text between the staves, "L.H." should go above. I'm also considering whether forcing the stem direction is at all beneficial — musically the high g is really acting like a soprano voice, rather than a continuation of the bass voice (regardless of which hand is playing it) wouldn't you agree? In that case, the staff-switch lines should probably be removed too. ... Commented Nov 27, 2021 at 20:23
  • ... This kind of begins to undermine the whole question though. This exert could be arranged on just one staff (treble clef) and played with only one hand. However it is posed as a coding question, not as a question on engraving or arranging, so that was my reasoning. Commented Nov 27, 2021 at 20:24
  • Sure, the discussion of notation style is secondary to the coding question, but it's valuable to mention. I suppose the standard notation style guides say something about the placement of L. H. and possibly also about the inclusion or omission of the staff-switch lines, but I'm not well enough informed on these matters to know what they say.
    – phoog
    Commented Nov 27, 2021 at 20:57

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.