3

I have piece of piano music that has two parts. In one part, chords are alternating between hands but I don't want to express staves precisely to leave it for a player. In the second part, the hands are playing together. I have problem regarding how to switch between \autochange and explicitly staving. Please look at the piece below:

\score{
    \new PianoStaff \chordmode {
        \new Staff = "up" {
            \autochange {
                \repeat unfold 4 { c,,8 c' }
            }
            {
                \repeat unfold 4 { c'' d'':m }
            }
            \new Staff = "down" {
                \clef bass
                \repeat unfold 4 { c,,8 d,,:m }
            }
        }
    }
}

enter image description here

The first bar is okay - there are no rests. But the second two bars should be combined together.

1 Answer 1

5

The problem is that \autochange is doing too many things automagically, and doing them in the wrong place. Specifically, it is creating two staves called "up" and "down", but the "down" staff is nested inside the first block of your score, and you are then creating another staff called "down".

One solution is to set up the staff structure of the PianoStaff explicitly, and put the \autochange inside that structure.

In the version below, the "down" staff starts from the beginning of the score, so you need the s1 to skip past the first bar.

Note, \context is similar to \new, except that all \contexts with the same name refer to the same object. In effect, that means you can refer to the "up" and "down" staves before \autochange has actually created them.

\score {
    \new PianoStaff <<
        \context Staff = "up" {
            \autochange {
                \chordmode {
                    \repeat unfold 4 { c,,8 c' }
                    \repeat unfold 4 { c'' d'':m }
        } } }
        \context Staff = "down" {
            \chordmode {
                s1
                \repeat unfold 4 { c,,8 d,,:m }
        } }
    >>
}

enter image description here

Actually, the way the above solution is structured is a bit convoluted. This is might be easier to understand and extend. The autochange creates the "up" and "down" staves, and the contexts then add more music to them. Then you must remember to define rhythm values for both staves.

\score {
    \new PianoStaff <<
        \autochange {
            \chordmode {
                \repeat unfold 4 { c,,8 c' }
        } }
        \context Staff = "up" {
            s1
            \chordmode {
                \repeat unfold 4 { c''8 d'':m }
        } }
        \context Staff = "down" {
            s1
            \chordmode {
                \repeat unfold 4 { c,,8 d,,:m }
        } }
    >>
}

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.