Reinhold Kainhofer <[email protected]> writes:
> The solution really depends on what you want to do with it.
For a piece of music, I want to generate score and midi.
Score is no problem.
The midi needs to be fold out w.r.t. repeats (unfoldRepeats can do that)
but there are also Segno / D.S. and D.C. sections.
Fold out, the piece becomes the following measures:
1, 2…36, 37, 22…36, 38, 2…20, 39…89
The current approach that I have works, but is rather tedious:
For each voice:
highMusic = {
\tag #'scoreOnly {
\highMusicPartOne
\bar "||" \mark \markup { \musicglyph #"scripts.segno" }
\highMusicPartTwoA
\bar "||"
\override Score.RehearsalMark #'self-alignment-X = #RIGHT
\mark \markup { \left-align \vcenter \bold "To Coda " \musicglyph
#"scripts.coda" }
\highMusicPartTwoB
\repeat volta 2 {
\highMusicPartThree
}
\alternative {
{ \highMusicPartFourA }
{ \highMusicPartFourB }
}
\bar "||"
\override Score.RehearsalMark #'self-alignment-X = #LEFT
\mark \markup { \vcenter { \musicglyph #"scripts.coda" \bold " Coda" } }
\highMusicPartFive
}
\tag #'midiOnly {
\highMusicPartOne
\highMusicPartTwoA
\highMusicPartTwoB
\highMusicPartThree
\highMusicPartFourA
\highMusicPartTwoA
\highMusicPartTwoB
\highMusicPartThree
\highMusicPartFourB
\highMusicPartTwoA
\highMusicPartFive
}
}
So, instead of splitting all voices, I'd like to write the voices in one
piece, and the use measure extraction to create the parts for the midi.
highMusicScore = \relative c' {
...
}
highMusic = {
\tag #'scoreOnly {
\highMusicScore
}
\tag #'midiOnly {
\extractMusic \highMusicScore s1*0 s1*1 % 1
\extractMusic \highMusicScore s1*1 s1*19 % 2..20
\extractMusic \highMusicScore s1*20 s1 % 21
\extractMusic \highMusicScore s1*21 s1*15 % 22..36
\extractMusic \highMusicScore s1*36 s1 % 37
\extractMusic \highMusicScore s1*21 s1*15 % 22..36
\extractMusic \highMusicScore s1*37 s1 % 38
\extractMusic \highMusicScore s1*1 s1*19 % 2..20
\extractMusic \highMusicScore s1*38 s1*51 % 39..89
}
}
-- Johan
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user