lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Macros


From: Mats Bengtsson
Subject: Re: Macros
Date: Tue, 28 May 2002 11:43:14 +0200

> > > a8 b
> > > #ifdef scientific
> > > c\footnote{..}
> > > #else
> > > cis
> > > #endif
> > > d
> >
> > Nothing is stopping you from using cpp for this now. Don't have to write
> > a completely new preprocessor for this.

Often, you can do this in Lilypond without any ifdefs or 
preprocessor. Just define the additional information using
a separate identifier and make two or more \score{} definitions
including different amount of information.

basic_melody=\notes{...}
editorial_additions = \notes{
s1*10 |
s4 () s2. | % Add extra slur in 11:th bar
s1*3 |
s2 s2^"Rit." |
...
}

\score{ % Plain version
  \basic_melody
}

\score{ % Editorial version
  \context Staff <\basic_melody \editorial_additions>
}

Of course it's slightly clumsy to have to count bars and
beats and insert the correct spacing between the additions.
Also, if you add articulation scripts or text scripts using
a separate Voice, the disadvantage is that the vertical
positioning of the scripts doesn't take the notes in other
voices into account, so the script may collide with a high note, 
for example.

For the specific application requested in the original email, 
the solution could be made much simpler. Once we have something
like a Footnote_engraver, it's just to turn off the specific
engraver when you don't want the footnotes. The same idea can
be used also in many other applications. If you for example
choose to use phrasing slurs for all editorial slurs and
normal slurs for the original ones, it's easy to remove
the phrasing slurs or print them with dashed lines.
Instead of separating original and editorial material using
different types of engravers, it is actually enough to keep
them in separate contexts (typically in separate Voices) to
make it possible to turn on and off the different features
individually in the \score definitions.

By the way, is there some easy way to turn off all engravers
in a specific context while keeping other contexts of the 
same type intact, for example removing one Voice out of
several?

   /Mats





reply via email to

[Prev in Thread] Current Thread [Next in Thread]