8. Simple examples

An example says more than thousand explanations, so in this chapter, I will present some advanced features of OrchestralLily using simple test cases. It should be easy to tell how to adapt the example in your own score...


8.1 Figured Bass

Figured bass can be either inserted like a staff (i.e. a direct child of a score or a staff group) or attached to a given staff (i.e. like a voice). These two cases are handled differently:

\version "2.11.40"
\include "../orchestrallily.ly"
\paper { ragged-bottom=##t }


\header { title = "Figured Bass" }

TestIMusic = { c''1 }
TestFBMusic = \figuremode { <6>4 <_+! [7 3-] _ 8>16 s16 s8 s4 s8 <8>  }
TestFBiMusic = \TestFBMusic

\orchestralScoreStructure #'(
  ("staff" "ParallelVoicesStaff" ("I" "FBi"))
  ; if no child is given, the name (here FB) is used for the music
  ("FB" "FiguredBass" ())
  ; equivalent to the line above!
  ("FigB" "FiguredBass" ("FB"))
)
\orchestralVoiceTypes #'(
  ("FBi" "FiguredBass")
)

TestPieceName = "Staff with Figured bass"
\createScore #"Test" #'("staff")

TestPieceName = "Figured bass without staff"
\createScore #"Test" #'("FB")
\createScore #"Test" #'("FigB")

[image of music]


8.2 Transposing music

OrchestralLily supports transposing staves by defining the pitches in [Piece][Instrument]TransposeFrom and [Piece][Instrument]TransposeTo. The meaning of the these pitches is exactly the same as in ”\transpose frompitch topitch music”. In one of them is not defined, middle c’ is used.

\version "2.11.40"
\include "../orchestrallily.ly"

\header { title = "OrchestralLily Transposition test case" }

TestIiMusic = \relative c' { \transposition f \key c \major c4 d e f }
TestIiiMusic = \relative c' { \transposition c \key f \major f4 g a b }
TestIiiiMusic = \relative c' { \transposition f \key c \major c4 d e f }
TestIivMusic = \relative c' { \transposition f \key c \major c4 d e f }

TestIxiMusic = \relative c' { \transposition f \key c \major c4 d e f }
TestIxiiMusic = \relative c' { \transposition c \key f \major f4 g a b }
TestIxiiiMusic = \relative c' { \key c \major c4 d e f }

\markup{"Transpose V1 to g', V3 from f'"}
TestIiTransposeTo = g
TestIiiTransposeFrom = f'
TestIivTransposeFrom = c'
TestIivTransposeTo = g
\createScore #"Test" #'("Ii" "Iii" "Iiii" "Iiv")

\markup{"Transpose everything to f'"}
TestTransposeTo = f'
TestIxiiTransposeTo = \relative c' { c1 }
TestIxiiiTransposeTo = \clef "bass"
\createScore #"Test" #'("Ixi" "Ixii" "Ixiii")

[image of music]


8.3 Using custom staff definitions

By default, OrchestralLily generates the whole staff definition from the music definition and the other settings. However, sometimes this is not desirable, because you want some special settings for one particular staff. In this case, you can simply define the staff yourself as ”[Piece][Instr]Staff” and OrchestralLily will make use of this staff definition:

\version "2.11.40"
\include "../orchestrallily.ly"

\header { title = "Defining a staff as a variable" }

TestIiMusic = \relative c' { c4 d e f }
TestIiiMusic = \relative c' { f4 g a b }

TestIiiStaff = \new Staff = "SomeStaffID" 
            \with { \remove Staff_symbol_engraver 
                    \override StaffSymbol #'line-count = #3 }
<< \TestIiiMusic >>

\markuplines \justified-lines {The second staff is not auto-generated, but defined manually in TestIiiStaff!}

\createScore #"Test" #'("Ii" "Iii")

[image of music]


8.4 Title pages

OrchestralLily provides a definition ”\\titlePageMarkup”for a nice title page, you only have to assign it as ”bookTitleMarkup” in the header block. It uses fields from the header block and formats a title page suitable for a professionally published score:

\version "2.11.40"
\include "../orchestrallily.ly"

#(set-global-staff-size 15)
\paper {
  line-width=10\cm
}

\header { 
  title = "A nice titlepage" 
  titlepagetitle = \markup \center-align { "A really nice" "titlepage"}
  subtitle = "using OrchestralLily"
  composer = "The software author"
%   poet = "Noone else"
  copyright = "No copyright on this trivial example"
  scoretype = "Full Score / Partitur"
  enteredby = "The editor"
  publisher = \markup \center-align { "Edition Kainhofer, 2008" 
                                      \line{Number of the score}}
%   date = "June 2008"
  ensemble = "Soli (SA), Coro e Orchestra o Organo"
  instruments = \markup { \column { 
    \line {"Flauto, 2 Clarinetti/Oboi, 2 Corni,"} 
    \line {"2 Trombe, Timpani, 2 Violini, Viola,"}
    \line {"Violoncello ed Contrabbasso"}} }
  subsubtitle = \markup{ \medium \fontsize #1 "Trivial to play" }
}


\paper {
  bookTitleMarkup = \titlePageMarkup
}

\pageBreak


TestIiMusic = { c''1 } 
\createScore #"Test" #'("Ii")

[image of music]


8.5 Table of contents

OrchestralLily automatically appends all piece headers to the internal table of TOC entries, you only have to display them using ”\markuplines \table-of-contents”. Also, you can insert your own headers using ”\createHeadline”.

\version "2.11.40"
\include "../orchestrallily.ly"

TestaIMusic = \relative c' { c1 }
TestbIMusic = \relative c' { d1 }

TestaPieceName = "Piece A"
TestbPieceName = "Piece B"

\markuplines \table-of-contents

\createHeadline "Custom headline (normal markup)"
\markup"Some markup"

\createScore #"Testa" #'("I")

\createHeadline "Another manual headline"

\createScore #"Testb" #'("I")

[image of music]


8.6 Equally-spaced markup columns

The ”\fill-line” markup command generates markup in columns, but unfortunately, the columns of different markups are not aligned with each other. If you want to insert translations to your score, you’ll have to use the ”\columns” command instead, defined in OrchestralLily:

\version "2.11.40"
\include "../orchestrallily.ly"

\header { 
  title="Equally-spaced column, aligned across markups" 
}
% Workaround for the docs (lilypond-book trying to be too smart)
% \paper { ragged-right = ##f line-width=15\cm}

\markup \line {\bold "Text of the \"Kyrie eleison\" (first song in a mass)" }
\markup {
  \line {\columns {
    \column { "Kyrie eleison," }
    \column { "Herr, erbarme dich," }
    \column { "Lord, have mercy," }
  }}
}

\markup \line {\bold "Text of the \"Gloria in excelsis Deo\""}
\markup {
  \line {\columns {
    \column {
      \italic "Gloria in excelsis Deo"
      "Et in terra pax"
      "..."
    }
    \column {
      \italic "Ehre sei Gott in der Höhe"
      "und Friede auf Erden"
      "..."
    }
    \column {
      \italic "Glory be to God on high,"
      "and on earth peace,"
      "..."
    }
  }}
}

[image of music]


8.7 Using cue notes

TODO


8.8 Markup using header fields

By default, markup in Lilypond does not have access to header fields (unless the markup is assigned to a header variable and called from one of the formatting functions defined in the header). OrchestralLily provides a function ”\markupWithHeaders”, which formats a given markup and allows access to header fields from this markup.

\version "2.11.40"
\include "../orchestrallily.ly"

\header { 
  title="My own title" 
  composer="Someone" 
  piece = "Global piece name"
}

testMarkup = \markup {
  \justify {
    This is a text inserted using the \typewriter{"\\markupWithHeader"} 
    command to allow using header fields 
    (via "\fromproperty #'header:fieldname"). For example, the title field 
    is \fontsize #+3 \fromproperty #'header:title and 
    the composer is \fontsize #+3 \fromproperty #'header:composer
  }
}

% Print out the markups. The \fromproperty #'header:field are now properly
% interpreted.
\markup\markupWithHeader \testMarkup

[image of music]


8.9 Default instrument names

OrchestralLily defines a lot of instrument names and clefs for the most common instrument abbreviations:

\version "2.11.40"
\include "../orchestrallily.ly"

\header { title = "OrchestralLily defines many instrument names" }


TestSSoloMusic = \relative c'' { c1 }
TestVcBMusic = \relative c { c1 }
TestFagIMusic = \relative c' { c1 }
TestVaMusic = \relative c' { c1 }
TestTrMusic = \relative c' { c1 }


\createScore #"Test" #'("SSolo" "VcB" "FagI" "Va" "Tr")

[image of music]


8.10 Non-standard staves

OrchestralLily also supports other staff types than the default. For example, a DrumStaff and a RhythmicStaff can easily be generated by a proper score structure definition. As the voice of a DrumStaff needs to be a DrumVoice, we also have to set this voice type once in our definitions.

The supported staff group types are: ”GrandStaff, PianoStaff, ChoirStaff, StaffGroup, InnerChoirStaff, InnerStaffGroup, ParallelMusic” and its equivalent ”SimultaneousMusic”.

The supported staff types are: ”Staff, DrumStaff, RhythmicStaff, TabStaff, GregorianTranscriptionStaff, MensuralStaff, VaticanaStaff, PartCombinedStaff, ParallelVoicesStaff” and ”FiguredBass”.

The supported voice types are: ”Voice, CueVoice” (for smaller notes), ”DrumVoice, FiguredBass, GregorianTranscriptionVoice, NoteNames, TabVoice” and ”VaticanaVoice”.

\version "2.11.40"
\include "../orchestrallily.ly"

\header { title = "Drum- and RhythmicStaff" }

TestIiMusic = \drummode { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
TestIiiMusic = \relative c'' { c2 c,8 e g c}
TestIiiiMusic = { c4\3 e2 <g c>16 <e g c>8. }

\orchestralScoreStructure #'(
  ("Ii" "DrumStaff" ())
  ("DS" "DrumStaff" ("Ii"))
  ("Iii" "RhythmicStaff" ())
  ("Iiii" "TabStaff" ())
)
\orchestralVoiceTypes #'(
  ("Ii" "DrumVoice")
  ("Iiii" "TabVoice")
)

\createScore #"Test" #'("Ii" "Iii" "Iiii")

\createScore #"Test" #'("DS")

[image of music]


Table of Contents

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