3. A simple example

Assume you have a piece called "Dada" with soprano solo (including lyrics) and violoncello. You might want to create a score for soprano only, one for cello one, one including both, a cello score including soprano (but in smaller size), etc.

We will call the soprano staff SSolo and the cello staff Vc. First, we need to define the music and lyrics for each, as well as the score structure. These will go into one file, say dada-defs.ly:

\version "2.11.40"
\include "orchestrallily.ly"
% \paper { line-width=10\cm }
% #(set-global-staff-size 14)

\header { title = "A nonsensical work" }

DadaPieceName = "Dada song"
DadaPieceNameTacet = "Dada song - Tacet"

VcInstrumentName = "Violoncello"
VcShortInstrumentName = "Vc."
SSoloInstrumentName = "Soprano Solo"
SSoloShortInstrumentName = "S."

VcClef = \clef "bass"
DadaSettings = {\mark\markup{\italic "Slow."}}

DadaVcMusic = \relative c { c4 g' c, b' }
DadaSSoloMusic = \relative c'' {c2 c,8 e g c}
DadaSSoloLyrics = \lyricmode { Da, da -- da -- da -- da! }

\orchestralScoreStructure #'(
  ("FullScore" ParallelMusic ("Percussion" "SSolo" "Vc"))
  ("InvertedScore" StaffGroup ("Vc" "SSolo" "Percussion"))

For each scores (full score, instrumental score, etc.), we write one additional file to generate the score.

Notice that all variables have a similar structure: First comes "Dada", then the instrument name ("SSolo" or "Vc"), and finally an indicator ("Settings", "Clef", "Music", "Lyrics", ...). For some of the variables, the instrument or the piece name is left out (This is only important for works with multiple pieces / movements, where you want one variable used in multiple pieces). Also notice that in the full score we have also added a "Percussion" instrument, but haven’t defined any music for it (because e.g. it will only play in the second movement, which we haven’t written yet). OrchestralLily will then simply ignore this instrument in the "Dada" part of the work.

Finally, the call \orchestralScoreStructure defines a FullScore and an InvertedScore with SSolo and Vc as children. This call tells OrchestralLily how the structure of your score looks like.

The above definitions are all that is needed by OrchestralLily to generate all various kinds of scores!

\version "2.11.40"
\include "dada-defs.ly"

% the soprano score:
\createScore #"Dada" #'("SSolo")

% the Vc score:
\createScore #"Dada" #'("Vc")

% the percussion score, no notes defined -> Tacet
\createScore #"Dada" #'("Percussion")

% the full score:
\createScore #"Dada" #'("FullScore")

[image of music]

The actual score creation is done with a call to \createScore, with the part name ("Dada" in our case) as the first argument and a list of instrument / staff group identifiers as second argument.

Now, suppose we want to generate a score for Vc, including the soprano staff in smaller size. This is also really simple in OrchestralLily:

\version "2.11.40"
\include "dada-defs.ly"

\header { instrument = \VcInstrumentName }

% For the SSolo staff, use a smaller staff size!
DadaSSoloSettings = {
    \set fontSize = #-4
    \override Staff.StaffSymbol #'staff-space = #(magstep -4)

\createScore #"Dada" #'("InvertedScore")

[image of music]

In full scores, the violoncello and contrabass staff is typically shown with a bracket (StaffGroup) of their own, and the solo staves are shown without any bracket. To achieve this, all you have to do is to define the correct score structure (including a VcB staff group, consisting only of the Vc staff):

\version "2.11.40"
\include "dada-defs.ly"

\orchestralScoreStructure #'(
  ("VcB" StaffGroup ("Vc"))
  ("FullScore" ParallelMusic ("Percussion" "SSolo" "VcB"))

\createScore #"Dada" #'("FullScore")

[image of music]

Although it was not explicitly shown in this simple example, OrchestralLily of course supports also nested staff groups.

Table of Contents

This document was generated by Reinhold Kainhofer on June, 4 2008 using texi2html 1.79.