bell notificationshomepageloginNewPostedit profiledmBox

Hoots : LilyPond piano score: switching between alternating and simultaneous chords 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 - freshhoot.com

10% popularity   0 Reactions

LilyPond piano score: switching between alternating and simultaneous chords
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 }
}
}
}
}

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


Load Full (1)

Login to follow hoots

1 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

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 }
} }
>>
}

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 }
} }
>>
}


Back to top Use Dark theme