OrchestralLilykainhofer.com/orchestrallily/orchestrallily.pdfFor each scores (full score,...

42
OrchestralLily A Lilypond package for orchestral scores. Reinhold Kainhofer, [email protected]

Transcript of OrchestralLilykainhofer.com/orchestrallily/orchestrallily.pdfFor each scores (full score,...

  • OrchestralLilyA Lilypond package for orchestral scores.

    Reinhold Kainhofer, [email protected]

    mailto:[email protected]

  • This is the documentation of the OrchestralLily package for Lilypond, the GNU music typeset-ting application.Copyright c© 2008 Reinhold Kainhofer, [email protected]

    mailto:[email protected]

  • i

    Table of Contents

    1 About OrchestralLily and Download . . . . . . . . . . . . . . . . . . . . . . . . . 1

    2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    3 A simple example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    4 Extended example: Multiple pieces . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    5 Structure of a score, naming staff groups . . . . . . . . . . . . . . . . . . 115.1 How to define this hierarchy in OrchestralLily . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125.2 Different staff and voice types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125.3 The advantage of giving each level a name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    6 What OrchestralLily does . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.1 How a score is generated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.2 How a staff group is generated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146.3 How a staff is generated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    7 Suffixes in use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    8 Simple examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178.1 Figured Bass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178.2 Transposing music . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188.3 Using custom staff definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198.4 Title pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208.5 Table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238.6 Equally-spaced markup columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248.7 Using cue notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258.8 Markup using header fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258.9 Default instrument names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268.10 Non-standard staves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    9 Settings defined/changed by OrchestralLily . . . . . . . . . . . . . . . . 29

    10 Available functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30\createScore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30\createNoCuesScore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30\orchestralScoreStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31\setUseBook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31\setCreateMIDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31\setCreatePDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31\namedCueDuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31\namedTransposedCueDuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32\cleffedCueDuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32\piece-title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32\markupWithHeaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Other functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

  • ii

    11 Extending OrchestralLily . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    12 Frequently asked questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34I don’t like the variable names, can I use a different order? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34I don’t like the structure of the score hierarchy list, can I change it? . . . . . . . . . . . . . . . . . . . . 34

    13 Version History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    14 Known limitations and missing features . . . . . . . . . . . . . . . . . . 36

    Appendix A Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    Appendix B OrchestralLily index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

  • Chapter 1: About OrchestralLily and Download 1

    1 About OrchestralLily and Download

    • Description: A Lilypond package to easily generate orchestral scores and other complexscores.

    • Author: Reinhold Kainhofer, [email protected]• Date: February 2008• Download: (Version 0.02, 2008-03-06), licensed under the GPL v3.0

    http://www.lilypond.org/http://reinhold.kainhofer.com/mailto:[email protected]://wiki.kainhofer.com/_media/lilypond/orchestrallily.ly

  • Chapter 2: Motivation 2

    2 Motivation

    Orchestral scores might have a quite complicated structure, which is cumbersome to constructmanually, in particular since each movement will have the same structure. The OrchestralLilypackage for Lilypond aids you by adding some more magic to lilypond’s already existing magic:You only define the structure of the whole piece once, you define the music that each instrumentplays in each movement, and lilypond will do the rest. In particular, OrchestralLily will• generate appropriate staves and staff groups• collate them in the proper (defined) order• add correct instrument names (if defined by the user)• add movement titles (if defined)• add a header "Movement name tacet" in an instrumental score for each movement where

    the instrument rests• add correct clefs, keys, time sigatures, transpositions and other settings to each staff (if

    defined by the user)• etc.

    This way, generating full scores, scores for individual instruments and for instrument groupsare really simple and no additional manual work!

    As you can imagine, if you have lots of parts and lots of instruments, the number of similarstaves/scores simply multiply (e.g. for 12 parts with 23 instruments, you’ll have 12*23=276individual staves, not counting any staff groups!). If you also want to include cue notes intothe instrumental scores, you’ll define a separate staff or score for the full score, where you callkillCues. Thus the number will automatically double!

    As they all look really similar, why not automate their creation instead of manually writingthem? That is exactly where OrchestralLily comes in.

    http://www.lilypond.org/

  • Chapter 3: A simple example 3

    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 celloscore 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 musicand 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 generatethe score.

    Notice that all variables have a similar structure: First comes "Dada", then the instrumentname ("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 forworks 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’tdefined any music for it (because e.g. it will only play in the second movement, which we haven’twritten yet). OrchestralLily will then simply ignore this instrument in the "Dada" part of thework.

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

    The above definitions are all that is needed by OrchestralLily to generate all various kindsof scores!\version "2.11.40"

  • Chapter 3: A simple example 4

    \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")

    A nonsensical work

    Dada song

    da!�� �

    Slow.�

    Da,�

    da

    � �da

    � �da

    � �

    Dada song

    �Slow.

    � � ���

    Dada song - Tacet

    Dada song

    Slow.

    ��

    �� �da!

    Violoncello

    Soprano Solo

    da�

    � da�Da,

    � �

    ���

    da

    ��

  • Chapter 3: A simple example 5

    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 secondargument.

    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 = {

    \DadaSettings\set fontSize = #-4\override Staff.StaffSymbol #’staff-space = #(magstep -4)

    }

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

    A nonsensical workVioloncello

    Dada song

    � �

    �Soprano SoloVioloncello

    da

    �da

    � �

    ��Slow.

    da

    ����

    Da,

    �da!

    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 achievethis, 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")

    A nonsensical work

  • Chapter 3: A simple example 6

    Dada song

    �da!

    ��Slow.

    �Cello eContrabbasso

    ��Violoncello

    Soprano Solo �

    �da�

    �Da,

    �da��

    da

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

  • Chapter 4: Extended example: Multiple pieces 7

    4 Extended example: Multiple pieces

    The whole power of OrchestralLily, however, becomes unleashed only for pieces with multiplemovements/sub-parts. Let us now add a second song "Didi", with only Timpani and SopranoSolo, as well as a third song "Dodo" with all instruments playing. For this, we have to add thecorresponding music to the definitions file dadafull-defs.ly, which becomes:\version "2.11.40"\include "orchestrallily.ly"% \paper { line-width=10\cm }% #(set-global-staff-size 14)

    \header { title = "A useless opus" }

    TimKey = \key c \majorTimClef = \clef "bass"TimInstrumentName = "Timpani"TimShortInstrumentName = "Tim."VcClef = \clef "bass"VcInstrumentName = "Violoncello"VcShortInstrumentName = "Vc."SSoloInstrumentName = "Soprano Solo"SSoloShortInstrumentName = "S."

    DadaPieceName = "1) Dada song"DadaPieceNameTacet = "1) Dada song - Tacet"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! }

    DidiPieceName = "2) Didi song"DidiPieceNameTacet = "2) Didi song - Tacet"DidiKey = \key fis \majorDidiTimMusic = \relative c { g1\startTrillSpan~ | g1\stopTrillSpan }DidiSSoloMusic = \relative c’ { fis8 cis’4. fis,8 cis’4. | fis8 cis’4. fis,8 cis’4.}DidiSSoloLyrics = \lyricmode { Di -- di, di -- di, di -- di, di -- di! }

    DodoPieceName = "3) Dodo song"DodoPieceNameTacet = "3) Dodo song - Tacet"DodoTimMusic = \relative c { c1\

  • Chapter 4: Extended example: Multiple pieces 8

    )

    After these definitions, we can easily generate individual instrumental scores, as well as a fullscore:\version "2.11.40"\include "dadafull-defs.ly"

    \header { instrument = \TimInstrumentName }

    \createScore #"Dada" #’("Tim")\createScore #"Didi" #’("Tim")\createScore #"Dodo" #’("Tim")

    A useless opusTimpani

    1) Dada song - Tacet

    2) Didi song

    ���

    �������

    3) Dodo song

    �ff

    ��������� �

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

    \header { instrument = \SSoloInstrumentName }

    \createScore #"Dada" #’("SSolo")\createScore #"Didi" #’("SSolo")\createScore #"Dodo" #’("SSolo")

    A useless opusSoprano Solo

    1) Dada song

  • Chapter 4: Extended example: Multiple pieces 9

    �da!���

    da

    � �da

    �da

    �Da,

    � �Slow.

    2) Didi song

    �di

    ���

    di!

    ��di

    ��

    di,

    ��di,

    ��di

    ��di,

    ��Di

    ��������

    3) Dodo song

    do...

    ff���do,

    ��do,

    ��do,�

    Do,� �

    do,

    ��do,

    ��do,

    ��

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

    \header { instrument = \VcInstrumentName }

    \createScore #"Dada" #’("Vc")\createScore #"Didi" #’("Vc")\createScore #"Dodo" #’("Vc")

    A useless opusVioloncello

    1) Dada song

    �� �Slow. � �

    2) Didi song - Tacet

    3) Dodo song

  • Chapter 4: Extended example: Multiple pieces 10

    � � �ff

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

    \createScore #"Dada" #’("FullScore")\createScore #"Didi" #’("FullScore")\createScore #"Dodo" #’("FullScore")

    A useless opus

    1) Dada song

    Violoncello

    Soprano Solo

    Slow.

    ��

    ��

    �Da,

    � �

    �da�

    Cello eContrabbasso

    ��

    ��

    �da�

    ��

    da!

    ��da

    2) Didi song

    di,

    ��Timpani

    �Soprano Solo�

    di!

    ��di

    ��

    di,

    ���

    ��������������

    ��������

    di

    ��

    �di,

    di

    Di

    3) Dodo song

    Soprano Solo

    Timpani

    ��Cello eContrabbassoVioloncello

    � �

    � �

    � ��

    do,

    � �do,

    ���������������������������

    �Do,

    �do,

    ff

    ffdo...

    ff

    �do,

    � �do,

    � �do,

  • Chapter 5: Structure of a score, naming staff groups 11

    5 Structure of a score, naming staff groups

    A full score typically consists of several levels of staves and staff groupings, which can alsobe understood as a hierarchy of staves. We will assign each level in this hierarchy an identifier(written in red in the example). For example, the score on the left has the tree:• "FullScore" (parallel staves/groups)

    • "Woodwinds" (staff group)• "Fl" (staff with two voices)• "Ob" (staff with two voices)

    • "Strings" (staff group)• "Violins" (grand staff)

    • "VI" (simple staff)• "VII" (simple staff)

    • "Va" (simple staff)• "Vocal" (parallel staves/groups)

    • "Solo" (parallel staves)• "SSolo" (simple staff)• "TSolo" (simple staff)

    • "Choir" (choir staff)• "S" (simple staff)

  • Chapter 5: Structure of a score, naming staff groups 12

    • "A" (simple staff)• "T" (simple staff)• "B" (simple staff)

    • "VcB" (staff group)• "Vc" (simple staff)

    So, the "FullScore" consists of parallel music of the following staves/groups: "Woodwinds","Strings", "Vocal" and "VcB". Similarly, "Choir" is a ChoirStaff and consists of the individualstaves "S", "A", "T" and "B". To be able to generate such a score automatically, lilypondneeds to know the structure of the tree. For this, it suffices to know the type and all children ofeach group, e.g. which staves/groups are direct children of "FullScore", which of "Vocal", etc.No information about the individual staves is needed yet.

    5.1 How to define this hierarchy in OrchestralLily

    This structure can be easily defined in OrchestralLily by calling \orchestral-score-structurewith a simple list describing the hierarchy:@xeatspaces {\orchestral-score-structure #’( ("FullScore" "SimultaneousMusic" ("Woodwinds" "Strings" "Vocal" "VcB")) ("Woodwinds" "StaffGroup" ("Fl" "Ob")) ("Fl" "PartCombinedStaff" ("FlI" "FlII")) ("Ob" "PartCombinedStaff" ("ObI" "ObII")) ("Strings" "StaffGroup" ("Violins" "Va")) ("Violins" "GrandStaff" ("VI" "VII")) ("Vocal" "SimultaneousMusic" ("Solo" "Choir")) ("Solo" "SimultaneousMusic" ("SSolo" "TSolo")) ("Choir" "ChoirStaff" ("S" "A" "T" "B")) ("VcB" "StaffGroup" ("Vc")) ; Staff types ("Percussion" "RhythmicStaff" ()) )}

    Please note the apostrophe before the list! There are no apostrophes needed in front of thestaff group types (because the whole is list is already quoted!).

    Each entry of the list describes one grouping of staves or voices and has three possible forms:@xeatspaces { ; Staff group of given type ("Identifier" "StaffGroupType" ("List" "of" "child" "identifiers")) ; Staves connected without a bracket ("Identifier" "SimultaneousMusic"|"ParallelMusic" ("List" "children" )) ; One staff with multiple voices ("Identifier" "ParallelVoicesStaff" ("List" "of" "voices")) ; Staff with two part-combined voices ("Identifier" "PartCombinedStaff" ("Two" "voices"))@c ; Non-default staff type ("Identifier" "StaffType" ()) ("Identifier" "StaffType" ("ChildVoiceName")) }

    The first entry creates a staff group of type StaffGroupType (e.g. StaffGroup, GrandStaff,PianoStaff, ChoirStaff), the second one (i.e. giving either "SimultaneousMusic" or "Paral-lelMusic" as staff type) creates parallel staves connected by a simple line, but no bracket. Inlilypond syntax, this is equivalent to >. The third and fourth forms are notreally staff groups, but staves containing multiple voices. The third one with #f as staff typegenerates a staff with multiple voices (\voiceOne, \voiceTwo, etc.), possibly with lyrics, whilethe fourth one with #t (for combined=##t) as staff type staff with two part-combined voices(e.g. Flute 1 and Flute 2 combined in one staff for Flute). Internally, \partcombine is used forthis (with all its limitations!).

    If an identifier from the list of child identifiers is not defined in that hierarchy list, it isassumed to be a simple staff.

    5.2 Different staff and voice types

    Lilypond supports more types than just ordinary staves: DrumStaff, FiguredBass, etc. InOrchestralLily, the type of a staff (e.g. DrumStaff, RhythmicStaff, etc.) can also be defineddirectly in the score structure by an entry like@xeatspaces { ; Non-default staff type ("Identifier" "StaffType" ()) ("Identifier" "StaffType" ("ChildVoiceName")) }

    TODO: Voice types

    5.3 The advantage of giving each level a name

    One of the advantages of assigning each group a name is that you can now tell OrchestralLilyto generate e.g. a vocal score (containing only the "Vocal" staff group). Whether you want togenerate an individual instrumental score, a full score, or a score for a group of instruments, isthen no difference to OrchestralLily: You simply tell OrchestralLily to generate the score for agiven identifier, and you will end up with the correct PDF. If you tell OrchestralLily to buildthe "FullScore" score, you’ll get a score with the group named "FullScore" (which happens tobe the full score), if you tell it to build "Fl", you’ll get a score with just one staff, namely the

  • Chapter 5: Structure of a score, naming staff groups 13

    one for the flutes. Similarly, to generate a pure choral score, simply tell OrchestralLily to buildthe score for the "Choir" group.

  • Chapter 6: What OrchestralLily does 14

    6 What OrchestralLily does

    Say you have the following structure of your score:@xeatspaces {@c ’( ("V" GrandStaff ("VI" "VII")) ("Strings" StaffGroup ("V" "Va")) ("FullScore" ParallelMusic ("Strings" "SSolo")) )@c }

    in you score structure definition. This means you have two violins, one viola and a sopranosolo.

    6.1 How a score is generated

    If you call@xeatspaces {\createScore #"PieceA" #"FullScore"}

    in your lilypond file, OrchestralLily will generate a score for you that is similar to the followinghand-written score:@xeatspaces {@c \score @{ > \header @{ piece = \PieceA[FullScore]PieceName @} @}@c }

    If there exists e.g. a variable \PieceAStringsStaff, it is used, otherwise the staff (group)will be generated by OrchestralLily as described below.

    If none of the sub-staves (and their sub-staves, etc.) contains any music, OrchestralLily willinstead create a title to indicate no music is to be played:@xeatspaces {\markup \piece-title \PieceA[FullScore]PieceNameTacet}

    Here, piece-title is the function used by OrchestralLily to format piece headings. It simplyreturns the proper markup definition for the given string.

    6.2 How a staff group is generated

    If there is no definition for \PieceAStringsStaff, it is generated (as a StaffGroup as definedin the score structure) by OrchestralLily and is equivalent to the following manual definition:@xeatspaces {@c \context StaffGroup = "\PieceAStringsSt" \with @{ instrumentName = \PieceAStringsInstrumentName shortInstrumentName = \PieceAStringsShortInstrumentName @} >@c }

    Again, if any of the PieceAVStaff or PieceAVaStaff variable is defined, it is inserted,otherwise the corresponding staff or staff group is created automatically (unless there is nomusic definition for it, in which case it is simply ignored). If any of the instrument namevariables is not defined, the corresponding assignment is left out (without any error or warningmessage!).

    If the definition of the Strings group in the score structure were a ParallelMusic orSimultaneousMusic, the generated code would be equivalent to@xeatspaces {@c >@c }

    without the possibility to have an instrument name attached.

    6.3 How a staff is generated

    If the staff for e.g. "SSolo" is not manually defined, OrchestralLily generates it in a formequivalent to@xeatspaces {@c \context Staff = "PieceASSoloSt" \with @{ instrumentName = \PieceASSoloInstrumentName shortInstrumentName = \PieceASSoloShortInstrumentName @} \context Lyrics = "PieceASSoloLyrics" \lyricsto "PieceASSoloVoice" \PieceASSoloLyrics >>@c }

    If no lyrics are defined (i.e. the variable \PieceASSoloLyrics is not defined), the \dynamicUpas well as the lyrics context is left out. Similarly, if any of the variables shown above is notdefined, it is simply left out without any warning or error. If no music is defined (e.g. thevariable \PieceASSoloMusic is not defined), no staff will be generated and it will simply be leftout in the parent group.

  • Chapter 7: Suffixes in use 15

    7 Suffixes in use

    in Score in Staff group inStaff

    Suffix StaffTypeParallel...PieceName Title for the

    piece- - -

    ...PieceNameTacet Piece title if nomusic is found

    - - -

    ...Staff Used asstaff/group

    - - -

    The following variablesare only used if ...Staffis not defined (i.e.the staff is created byOrchestralLily):

    ...Music - - - used as music for thestaff

    ...Lyrics - - - Lyrics assigned tomusic

    ...Settings - - - music expression atbeginning of staff

    ...Clef - - - music expression atbeginning of staff

    ...Key - - - music expression atbeginning of staff

    ...TimeSignature - - - music expression atbeginning of staff

    ...TransposeTo - - - pitch, definition posi-tion of middle c’ forthe piece

    ...InstrumentName - assigned as in-str. name

    - assigned as instr.name

    ...ShortInstrumentName- assigned as in-str. name

    - assigned as instr.name

    ...MidiInstrument - assigned asMIDI instr.

    - assigned as MIDIinstr.

    The order in which these variables are looked up is also relevant. If you are printing the scorefor piece "PieceA" and the currently processed instrument/group is "Instr", OrchestralLily willtest the following variable names (in this order):@xeatspaces {@c \PieceAInstrSuffix \InstrSuffix \PieceASuffix@c }

    This particular order ensures that you can have a definition for each score-instrument com-bination, which overrides everything else (e.g. the definition of the music should probably usethis variable). However, for piece titles, keys and so on, you can have one definition, whichapplies to all instruments in that piece (the third form). On the other hand, some instruments(e.g. transposing instruments) need some special settings, which should override the piece-widesettings (like the key). For this, the second form is provided.

    In the following we will typically give the variable name in full form \PieceAInstrSuffixwith the understanding that of course \InstrSuffix and \PieceASuffix will be used if the full

  • Chapter 7: Suffixes in use 16

    form variable does not exist. If any part is written in square brackets [..], this indicates that thispart is typically left out and instrument- or piece-wide variables are usually used in this place.

    One word or care, though: Be careful with variables of the form \InstrStaff. If you defineit, OrchestralLily will use that staff for the given instrument for each part of the whole workand never generate a staff for you!!! Similarly, if you define \PieceAStaff, all instruments inPieceA will get this staff, unless you manually define a staff for an instrument!

    FIXME Add ...Transposition

  • Chapter 8: Simple examples 17

    8 Simple examples

    An example says more than thousand explanations, so in this chapter, I will present someadvanced features of OrchestralLily using simple test cases. It should be easy to tell how toadapt 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) orattached 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 { 4 16 s16 s8 s4 s8 }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")

    Figured Bass

    Staff with Figured bass

    �� 867�3

    8

  • Chapter 8: Simple examples 18

    Figured bass without staff

    8

    �37

    8�6

    Figured bass without staff

    �37

    8

    86 �

    8.2 Transposing music

    OrchestralLily supports transposing staves by defining the pitches in[Piece][Instrument]TransposeFrom and [Piece][Instrument]TransposeTo. The meaningof the these pitches is exactly the same as in ”\transpose frompitch topitch music”. In one ofthem 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 = gTestIiiTransposeFrom = 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")

    OrchestralLily Transposition test case

  • Chapter 8: Simple examples 19

    Transpose V1 to g', V3 from f'

    � ��

    ��

    ��

    ��

    ��

    ���

    ��

    ��������

    Transpose everything to f'

    ��

    ��

    ��

    �����

    ��

    ���

    8.3 Using custom staff definitions

    By default, OrchestralLily generates the whole staff definition from the music definition andthe other settings. However, sometimes this is not desirable, because you want some spe-cial 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 }>

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

  • Chapter 8: Simple examples 20

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

    Defining a staff as a variable

    The second staff is not auto-generated, but defined manually in TestIiiStaff!

    �� �

    ��� ��� � ��

    8.4 Title pages

    OrchestralLily provides a definition ”\\titlePageMarkup”for a nice title page, you only have toassign it as ”bookTitleMarkup” in the header block. It uses fields from the header block andformats 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" }}

  • Chapter 8: Simple examples 21

    \paper {bookTitleMarkup = \titlePageMarkup

    }

    \pageBreak

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

  • Chapter 8: Simple examples 22

    The software author

    A really nicetitlepage

    using OrchestralLily

    Soli (SA), Coro e Orchestra o OrganoFlauto, 2 Clarinetti/Oboi, 2 Corni,2 Trombe, Timpani, 2 Violini, Viola,Violoncello ed Contrabbasso

    Full Score / Partitur

    Herausgegeben von: / Edited by:

    The editor

  • Chapter 8: Simple examples 23

    � ��

    8.5 Table of contents

    OrchestralLily automatically appends all piece headers to the internal table of TOC entries, youonly have to display them using ”\markuplines \table-of-contents”. Also, you can insert yourown 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")

    Inhalt / Contents

    ?Custom headline (normal markup)

    ?Piece A

    ?Another manual headline

    ?Piece B

    Custom headline (normal markup)

    Some markup

    Piece A

  • Chapter 8: Simple examples 24

    � � �Another manual headline

    Piece B

    � ��8.6 Equally-spaced markup columns

    The ”\fill-line” markup command generates markup in columns, but unfortunately, the columnsof different markups are not aligned with each other. If you want to insert translations to yourscore, 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,"

  • Chapter 8: Simple examples 25

    "..."}

    }}}

    Equally-spaced column, aligned across markups

    Text of the "Kyrie eleison" (first song in a mass)

    Kyrie eleison, Herr, erbarme dich, Lord, have mercy,

    Text of the "Gloria in excelsis Deo"

    Gloria in excelsis DeoEt in terra pax...

    Ehre sei Gott in der Höheund Friede auf Erden...

    Glory be to God on high,and on earth peace,...

    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 isassigned to a header variable and called from one of the formatting functions defined in theheader). OrchestralLily provides a function ”\markupWithHeaders”, which formats a givenmarkup 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 fieldis \fontsize #+3 \fromproperty #’header:title andthe composer is \fontsize #+3 \fromproperty #’header:composer

    }}

    % Print out the markups. The \fromproperty #’header:field are now properly% interpreted.

  • Chapter 8: Simple examples 26

    \markup\markupWithHeader \testMarkup

    My own titleSomeone

    This is a text inserted using the \markupWithHeadercommand to allow using header fields (via\fromproperty #'header:fieldname ). For example, thetitle field is My own title and the composer isSomeone

    8.9 Default instrument names

    OrchestralLily defines a lot of instrument names and clefs for the most common instrumentabbreviations:\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")

    OrchestralLily defines many instrument names

    ��������

    ��

    ���

    ��

    Tromboni

    Viola

    Fagotto I

    Cello eContrabbasso

    Soprano Solo

  • Chapter 8: Simple examples 27

    8.10 Non-standard staves

    OrchestralLily also supports other staff types than the default. For example, a DrumStaff and aRhythmicStaff can easily be generated by a proper score structure definition. As the voice of aDrumStaff 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, In-nerChoirStaff, InnerStaffGroup, ParallelMusic” and its equivalent ”SimultaneousMusic”.

    The supported staff types are: ”Staff, DrumStaff, RhythmicStaff, TabStaff, GregorianTran-scriptionStaff, MensuralStaff, VaticanaStaff, PartCombinedStaff, ParallelVoicesStaff” and ”Fig-uredBass”.

    The supported voice types are: ”Voice, CueVoice” (for smaller notes), ”DrumVoice, Figured-Bass, 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 16 8. }

    \orchestralScoreStructure #’(("Ii" "DrumStaff" ())("DS" "DrumStaff" ("Ii"))("Iii" "RhythmicStaff" ())("Iiii" "TabStaff" ())

    )\orchestralVoiceTypes #’(("Ii" "DrumVoice")("Iiii" "TabVoice")

    )

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

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

    Drum- and RhythmicStaff

    ��

    20

    �����

    ���

    3� -7

    ��

    30

    ��

    2

    � ����

    � ���

  • Chapter 8: Simple examples 28

    ��

    �� �� ����������

  • Chapter 9: Settings defined/changed by OrchestralLily 29

    9 Settings defined/changed by OrchestralLily

    • Proper rest combination for staves with two voices:

    ���� � ���• modern-cautionary style for auto-accidentals. Cautionary accidentals are shown in brackets

    for one bar, after that no cautionary accidental is shown any more.

    ����� �� � ����� ��� �� �� ����• FIXME lots of other things (not yet documented) in the context hierarchy. See the orches-

    trallily.ly file (at the end of the file)

  • Chapter 10: Available functions 30

    10 Available functions

    \paragraph "text" \piece-titlepage "markup" \orchestralScoreStructure ’(structurelist) \orchestralVoiceTypes ’(voice type list) (oly:register staff type handler type func)(oly:register voice type handler type func) \setUseBook #t/#f \setCreateMIDI #t/#f\setCreatePDF #t/#f \createScore #"Piece" ’("Instrument"...) \createNoCuesScore#"Piece" ’("Instrument"...) \createHeadline "text of the headline"

    \setCue "cueString" \setClefCue "cueString" clef \namedCueDuring "CueVoice" #DIR "In-strCue" "Instr" music \namedTransposedCueDuring "CueVoice" #DIR "InstrCue" "Instr"Transposition music \cleffedCueDuring "CueVoice" #DIR "InstrCue" ClefCue "Instr" ClefInstTransposition music

    \tempoMark ’(padding . padding) #"Marktext" \shiftDynamics #x #y

    Dynamic text: \ffz, \pf, \sempp, \parenf, \parenp Dynamic spanners: \setDim, \dim,\enddim, \setDecresc, \decresc, \enddecresc, \setCresc, \cresc, \endcresc

    \newOrOldClef "new" "old" (depending on (ly:get-option ’old-clefs)) \filterArticulations mu-sic (removed all articulations, dynamics, text scripts and multi-measure text events)

    \when-property symbol markup \vspace #space

    \markupWithHeader markupVariable \columns markup-list

    \newInstrument "instrumentName" (set cue name with "+") \cueText (= \setCue !!!!!)

    \scoreNumber nr

    Settings: \contentsTitle (title for the TOC) \titlePageMarkup (book title as header) \title-HeaderMarkup (book title as title page) \titleScoreMarkup (score title as markup)

    \createScore

    Generates the score for the given piece and the given instrument(s). If no appropriate *Staff or*Music can be found, a header with the *PieceName (or the *PieceNameTacet) string will beprinted.

    @xeatspaces {\createScore #"PieceID" #’("Instrument1" "Instrument2" ...) }

    • Typical call: \createScore #"IIIChor" #’("T")• Parameters:

    PieceID The identifier for the piece/movement, which is part of the variable names usedto generate the score

    Instrument listThe list of instruments/staff identifiers to be shown in the score. These iden-tifiers either indicate a staff group (as defined in the score structure list) or asingle instrument (where the *Staff or *Music variables are used to create thestaff).

    \createNoCuesScore

    Like \createScore, except that \killCues and \removeWithTag ’cued is applied to all themusic/staves

    @xeatspaces {\createNoCuesScore #"PieceID" #’("Instrument1" "Instrument2" ...)}

    • Typical call: \createNoCuesScore #"IIIChor" #’("T")

  • Chapter 10: Available functions 31

    \orchestralScoreStructure

    @xeatspaces {\orchestralScoreStructure #’( ("ID" ’StaffType ("List" "Of" "Instruments"))... ))}

    * Typical call:@xeatspaces {\orchestralScoreStructure #’( ; Part-combined staves (one staff with two voices) ("Fl" #t ("FlI" "FlII")) ; Grouped staves (multiple staves either in a StaffGroup, or parallel without a bracket) ("Str" ’StaffGroup ("V" "Va")) ("Solo" ’ParallelMusic ("SSolo" "TSolo")) ("Ch" ’ChoirStaff ("S" "A" "T" "B")) ("Vocal" ’SimultaneousMusic ("Solo" "Ch")) ; full scores, again as grouped staves, no over-all bracket ("FullScore" ’ParallelMusic ("Fl" "Str" "Solo" "Ch")) )@c }

    * Description: Defines the hierarchy tree of the score. Each staff group (or part-combinedstaff with two voices) is identified by an ID (the first element of each entry). * Parameters:Score structure ... A list of group descriptions. Each entry describes such a group and has threepossible forms: ("Identifier" StaffGroupType ("List" "of" "child" "identifiers")); Staff group of given type ("Identifier" SimultaneousMusic|ParallelMusic ("List""children" )) ; Staves connected without a bracket ("Identifier" #f ("List" "of""voices")) ; One staff with multiple voices (not yet implemented!) ("Identifier"#t ("Two" "voices")) ; Staff with two part-combined voices The list can contain eachidentifier only once, but they do not have to form only one tree, you can define several differenthierarchy trees in one list!

    \setUseBook

    @xeatspaces {\setUseBook ##t}

    * Typical call: \setUseBook ##t * Description: Declare whether the scores are called within a\book section or as top-level. * Explanation: Internally, a score needs to be created differentlyif it should be printed inside a \book environment. Unfortunately, it is not possible in lilypondto detect the current environment, so this function is needed to explicitly declare that thefollowing scores are inserted inside a \book environment. * Parameters: * inside book ... ##t ifthe following scores are inside a \book environment, ##f if not (default) setUseBook = #(define-music-function (parser location usebook) (boolean?)

    \setCreateMIDI

    Set a flag to determine whether MIDI output should be generated (default: NO). If YES, thenan empty \midi{} block is generated in the score to trigger the creation of the midi file.@xeatspaces {\setCreateMIDI ##t}

    * Typical call: \setCreateMidi ##t

    \setCreatePDF

    Set a flag to determine whether PDF output should be generated (default: YES). If no, no\layout{} block will be generated in the score. If create MIDI == #t, then only MIDI willbe created. If create MIDI == #f, then the PDF output will still be generated (similar to theexistence/non-existence of a \midi and \layout block in a score!).@xeatspaces {\setCreatePDF ##t}

    * Typical call: \setCreatePDF ##t

    \namedCueDuring

    Like \cueDuring, but also adds the instrument name of the cue instrument at the beginning ofthe cue notes and the original instrument name after the cue notes.@xeatspaces {\namedCueDuring #"QuoteName" #DIR #"cue instrument" #"original instrument" music}

    * Typical call: \namedCueDuring #"vIQuote" #UP #"V.I" #"Sop." { R1*3 } * Parameters:* quote name, direction, music ... Parameters of \cueDuring * cue instrument, original instru-ment ... Instrument names (strings) to be printed as cue instrument name at the beginning ofthe cues and as original instrument name after the cue notes

  • Chapter 10: Available functions 32

    \namedTransposedCueDuring

    Like \namedCueDuring, but uses \transposedCueDuring instead of \cueDuring.@xeatspaces {\namedTransposedCueDuring #"QuoteName" #DIR #"cue instrument" #"original instrument" centralCNote music}

    * Typical call: \namedTransposedCueDuring #"vIQuote" #UP #"Piccolo" #"Sop." c’ {R1*3 }

    \cleffedCueDuring

    Like \namedCudDuring, but shows the cue notes with a different clef.@xeatspaces {\cleffedCueDuring NameOfQuote CueDirection CueInstrument CueClef OriginalInstrument OriginalClef music}

    * Typical call: \cleffedCueDuring #"vIQuote" #UP #"V.I" {\clef "treble"} #"Basso"{\clef "bass"} { R1*3 }

    % Parameters: \cleffedCueDuring NameOfQuote CueDirection CueInstrument CueClef Orig-inalInstrument OriginalClef music % -) NameOfQuote CueDirection music are the parametersfor \cueDuring % -) CueInstrument and OriginalInstrument are the displayed instrument names% -) CueClef and OriginalClef are the clefs for the the cue notes and the clef of the containingvoice

    % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I"at % the beginning of the cue notes and "Basso" at the end. The clef is changed to treble atthe % beginning of the cue notes and reset to bass at the end

    \piece-title

    @xeatspaces {\piece-title pieceTitleString}

    FIXME

    \markupWithHeaders

    Other functions

    FIXME: not yet documented

  • Chapter 11: Extending OrchestralLily 33

    11 Extending OrchestralLily

    TODO: #(oly:register staff type handler type func) #(oly:register voice type handler typefunc)

  • Chapter 12: Frequently asked questions 34

    12 Frequently asked questions

    I don’t like the variable names, can I use a different order?

    If you don’t like that the variables are generated as \PieceInstrumentVarname, you can overridethis behavior by redefining the scheme function (namedPieceInstrObject piece instr name).The default implementation is:@xeatspaces {@c #(define (namedPieceInstrObject piece instr name) (let* ( (fullname (string->symbol (string-append piece instr name))) (instrname (string->symbol (string-append instr name))) (piecename (string->symbol (string-append piece name))) ) (cond ((defined? fullname) (primitive-eval fullname)) ((defined? instrname) (primitive-eval instrname)) ((defined? piecename) (primitive-eval piecename)) (else ’()) ) ) )@c }

    Now it’s up to you to write a different implementation... (e.g. use varnames of the style\VarnameInstrPiece) But be careful with the order of evaluation, since some large scoresmight depend on instrname overriding piecename (e.g. a globally-defined key for transposinginstruments!).

    I don’t like the structure of the score hierarchy list, can Ichange it?

    Sure, there is only one function that interprets the entries (factory pattern!): (oly:create_staff_or_group parser piece instr). It looks up the \PieceInstrumentStaff variable andif that does not exist, it looks at a possible entry in the score structure descriptions and dependingon its form, calls different methods to create a staff, a group, a part-combined staff or a staffwith multiple voices.

    If you redefine this function, you have complete control about the decision when to createeach type of staff/group.

  • Chapter 13: Version History 35

    13 Version History

    0.01 (2008-03-02):Initial Version

    0.02 (2008-03-06):Added basic MIDI support (...MidiInstrument and \setCreateMIDI)

    0.03 (2008-03-??):-) Add *TimeSignature variable, split settings for full/vocal/instrumental scores-) [Piece][Instrument]TransposeTo, if set, now specifies the pitch where c’ shouldbe shown in the applicable voices. -) interpreting markup using header fields -)Automatically add score title to TOC -) \createHeadline to create a headline andadd it to the TOC -) Adapted cresc spanners to new syntax -) Nice title page (fullpage) and nicer title header (for instrumental scores) -) Default clefs and Instrumentnames for lots of common abbreviations -) Default cue names fo lots of instruments,function to show cue name -) Default score numbers for each instrument -) onecan also specify voice types -) parallel voices in one staff work, -) Group types aregiven as strings -) Adding handlers for new group/staff or voice types supported -)Support for Drum staves/voices and figured bass

  • Chapter 14: Known limitations and missing features 36

    14 Known limitations and missing features

    • FIXME Staves with multiple voices (using \voiceOne, \voiceTwo), mess up the \voiceOneand \voiceTwo setting for some weird reason.

    • FIXME Add support for MIDI instrument names

  • Appendix A: Credits 37

    Appendix A Credits

    Of course, a huge project like OrchestralLily would have never been possible without the help ofmany others. In particular, I’m indebted to Han-Wen Niewenhuis and Jan Nieuwenhuizen, thetwo authors of Lilypond. The folks over at the lilypond-user and lilypond-devel mailinglist werealso of great importance and helped me solve lots of problems I ran into. A particular thanksgoes to Nicolas Sceaux, who help me enourmously with his deeps insight into the Lilypondinternals and the tricks he provided on the mailinglist and in his own Lilypond package foroperas. Of course, all the authors of snippets posted at the LSR (Lilypond Snippet Repository)also contributed their share to the success of OrchestralLily.

  • Appendix B: OrchestralLily index 38

    Appendix B OrchestralLily index

    (Index is nonexistent)

    About OrchestralLily and DownloadMotivationA simple exampleExtended example: Multiple piecesStructure of a score, naming staff groupsHow to define this hierarchy in OrchestralLilyDifferent staff and voice typesThe advantage of giving each level a name

    What OrchestralLily doesHow a score is generatedHow a staff group is generatedHow a staff is generated

    Suffixes in useSimple examplesFigured BassTransposing musicUsing custom staff definitionsTitle pagesTable of contentsEqually-spaced markup columnsUsing cue notesMarkup using header fieldsDefault instrument namesNon-standard staves

    Settings defined/changed by OrchestralLilyAvailable functions\createScore\createNoCuesScore\orchestralScoreStructure\setUseBook\setCreateMIDI\setCreatePDF\namedCueDuring\namedTransposedCueDuring\cleffedCueDuring\piece-title\markupWithHeadersOther functions

    Extending OrchestralLilyFrequently asked questionsI don't like the variable names, can I use a different order?I don't like the structure of the score hierarchy list, can I change it?

    Version HistoryKnown limitations and missing featuresCreditsOrchestralLily index