Hi Michael, thank you so much for taking the time to write out an example. I was able to modify it to work for two PianoStaff objects. One question: you add some extra padding between the two variants with an \override; is there a way to do the same thing for modifying the padding between two PianoStaff groups (but not change the staff-staff spacing within each of them)?
Thanks again! Andrew er/ihn/ihm/sein | he/him/his Berlin On Wed, Nov 1, 2023 at 4:51 PM Michael Werner <[email protected]> wrote: > On Wed, Nov 1, 2023 at 10:59 AM N. Andrew Walsh <[email protected]> > wrote: > >> Hi List, >> > > Hi Andrew, > > >> I have a client who's written a piece where he wants the last 16 bars to >> have two different variations, to be freely chosen by the performer. Sort >> of a choose-your-own-adventure score. It's scored for two voices and piano, >> but the ending(s) would only be the piano. >> >> So, grossly simplified, the score would have bars 1-53 as normal music, >> and then the performer adds a coda of either "A" or "B", each of which is a >> 16-bar section of one of the two variations. The bar numbers should be the >> same. >> >> How would I structure the score to do this? I'm thinking it'd be >> preferable to have the two variations on the top and bottom of each page, >> so that it's clear they're parallel, but I'm not sure how to set it up. >> > > Well, like many things with Lilypond I'm sure there's more than one way to > do things. My take on this would be something like this: > > \version "2.25.9" > > length_of_main = #8 > length_of_alt = #4 > > music_main = \relative c' { > \repeat unfold \length_of_main { a4 b c d } > %\break > \repeat unfold \length_of_alt { s1 } > } > > music_a = \relative c' { > \repeat unfold \length_of_main { s1 } > \break > \sectionLabel \markup { \bold "A or B - pick one!" } > \repeat unfold \length_of_alt { c4 b a b } > } > > music_b = \relative c' { > \repeat unfold \length_of_main { s1 } > \repeat unfold \length_of_alt { e4 d c d } > } > > \new StaffGroup > << > \new Staff \with { > instrumentName = "Main" > shortInstrumentName = "Main" > \RemoveAllEmptyStaves > } \music_main > \new Staff \with { > instrumentName = "A" > shortInstrumentName = "A" > \RemoveAllEmptyStaves > \override VerticalAxisGroup.staff-staff-spacing.padding = #8 > } \music_a > \new Staff \with { > instrumentName = "B" > shortInstrumentName = "B" > \RemoveAllEmptyStaves > } \music_b > >> > > Here, music_main is the first part of the music running along by itself, > with music_a and music_b the two possible alternates. The main thing will > be to watch the spacer rests at the beginning of music_a and music_b - they > need to be the right number of measures worth. By using the variables in > the unfold statement I find it a bit easier to keep track and make sure the > right numbers are getting where they need to be. Also I've added some extra > space between the two alternates, might reinforce that they're only sorta > kinda together but not really. > > Don't know if this is quite what you're after, but maybe it'll at least > serve as a starting point. > -- > Michael > >
