On Sat, Jan 09, 2016 at 12:11:48AM -0600, [email protected] wrote:
> On Fri, 8 Jan 2016, Christopher R. Maden wrote:
> > Generally, once you get into any kind of moderately complicated
> > score, you have to concoct your score and MIDI separately, e.g.:
> >
> > theTune = c c c c
> > theScore = \repeat volta 2 { \theTune }
> > theMidi = \theTune \transpose c c' \theTune
> > \score{ \theScore \layout{} }
> > \score{ \theMidi \midi{} }
>
> This is pretty much exactly what I do for a similar instruction in an
> original ragtime piece.
>
> It's a shame that LilyPond's requirement to completely evaluate music
> expressions immediately, and therefore once and for all, forces this
> kind of thing on us. The natural thing to want to do would be to have
> an "if (MIDI) { }" kind of construction at the point in the music
> where there's a difference; but that's simply impossible the way
> LilyPond currently works. And so anyone who wants both a printed
> score and MIDI is forced to write the whole thing twice over,
> attempting to keep the two versons updated relative to each other by
> hand, with the ability to share code only at the lowest levels of the
> hierarchy.
[...]
This is not really true. What I usually do is something like this:
music = <<
\new Staff {
a1 b c
\tag #'midi { a8 r b r c r }
\tag #'layout { a4-. b-. c-. }
}
>>
\score {
\removeWithTag #'midi \music
\layout {}
}
\score {
\removeWithTag #'layout \music
\midi {}
}
The \tag #'layout and \tag #'midi lines basically behave like an if
(MIDI) block. This lets you intersperse layout-specific and
midi-specific stuff in the same place, so that you don't forget to
update one after editing the other.
T
--
The richest man is not he who has the most, but he who needs the least.
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user