<<

Lilypond: An Introduction to Creating Beautiful Music and Musical Documents Presented by Kevin Albright FMEA State Conference 2015

Lilypond LilyPond is a compiled system: it is run on a text file describing the music. The resulting output is viewed on-screen or printed. In some ways, LilyPond is more similar to a programming language than graphical editing software. You do not write music by dragging notes from a graphical toolbar and placing them on a dynamically refreshing score; you write music by typing text. This text is interpreted (or “compiled”) by LilyPond, which produces beautifully engraved .

Programs and Download Links Lilypond • creates printed music from text descriptions of music

• download: http://www.lilypond.org/download.html

• PDF learning document: http://lilypond.org/doc/v2.18/Documentation/learning.pdf

Frescobaldi • a graphical front-end Lilypond editor

• download: http://frescobaldi.org/download

LibreOffice • a suite of office programs, including 'Writer', the document editor which uses the 'OooLilypond extension.' • download: http://www.libreoffice.com

OooLilypond Extension • an extension to create and store Lilypond music within a document

• download: http://extensions.openoffice.org/en/project/ooolilypond The of Lilypond's Language

Bracket Organzation { … } Encloses a sequential segment of music < … > Encloses the notes of a chord << … >> Encloses simultaneous music expressions ( … ) Marks the start and end of a slur \( … \) Marks the start and end of a phrasing slur [ … ] Marks the start and end of a manual beam

Examples

• Sequential music enclosed in curly { … } • Commands start with \ • Letters are notes • Numbers are durations

{ \time 2/4 \ bass c4 c g g a a g2 \bar "|." }

Octave Designation To avoid typing octave designation for every note, use the command /relative to set the starting reference point. Then, closest pitches are used, comma lowers and apostrophe raises to next octave.

% -- explicit -- { \clef bass c,,,4 c,, c, c \clef treble c' c'' c''' c''''} % – relative -- /relative c,,, { /clef bass c4 c' c' c' /clef treble c' c' c' c' } • Commands \relative and \key used (\key requires \major or \minor) • slur indicated by ( … ) • Accidentals are independently declared from ; sharps indicated by 'is' and flats by 'es' • Chords grouped by < … > • Dash indicates articulation and period indicates staccato

\relative c'' { \key c \minor g( ) -. -. }

• Multiple simultaneous elements (chords, notes and lyrics) wrapped together with << … >> • Lyric syllabic placement automatically follow slurs • Ties indicated by the tilde ( ~ )

<< \chords { c1:m7 f2:7 c2 } \relative c'' { g2 es8( c4) es8 f8 es d c~ c2 } \addlyrics { You are the sky and my rain, } >>

• Multiple voices on one staff wrapped together with << … >> separated by \\ • Comment lines (ignored by compiler) for user reference start with %

\new Staff \relative c' ' { \key g \major % Voice "1" Voice "2" << { g4 fis8( g) a4 g } \\ { d4 d d d } >> } • Dynamics added with backslash ( \p \mp \mf etc.) • Hairpins started with backslash and < or >, ending with \! • Articulations added after dash • Multiple elements can be stacked on one note • \break command sets a manual system change

\relative c' { c4\p\< d e f-^ | g-_ g-. g2-- \break g4->\ff\!\> f e d | c c c2\pp\! \bar "|." }

• Figures command • Comment lines (ignored by compiler) for user reference start with %

<< \relative c { \clef bass c4 d e fis | g g c,2 \break a4 e' a, c | f f e2 \bar “|.” } \figures { r4 <6 4> <6> <6 5> | <6 4> <7> r2 | r4 <_!> r4 <7-> | r4 <4 2> <6>2 } >>

Can you create this snippet?

\ ______{ (start of music expression and starting reference) \ ______\ ______(key) (notes with values – first measure) ______| (notes with rhythmic values – including tie) ______

(final barline and close of expression) \ ____ “__” } OooLilypond Extension Editor

Simple Excerpts When creating short, relatively simple excerpts, it is best to use the built-in editor with the default template. You my want to make the Staff Size bigger if students are to write on the staff. The “Custom 1:” setting is a transposition tool. Until changed, the default is to transpose your excerpt an octave. You can use the “Edit” button to change these defaults as I have below.

More Complicated Excerpts If you are importing more complicated examples from Frescobaldi or from the Internet, change the template to “Direct to Lilypond.” Then be sure to enter the following tag in the Lilypond code to create your music excerpt as a graphic rather than attempting to create a full printed page: /include “lilypond-book-preamble.ly” Common Snippets for Music Education Use these in the “Direct to Lilypond” template in the OooLilypond Editor or paste directly in the Frescobaldi editor.

\include "lilypond-book-preamble.ly" \include "lilypond-book-preamble.ly" #(set-global-staff-size 20) #(set-global-staff-size 20)

\paper { \paper { #(define dump-extents #t) #(define dump-extents #t) ragged-right = ##t ragged-right = ##t line-width = 17\cm line-width = 17\cm } }

\layout { \layout { = #0 indent = #0 \ { \Score \remove "Bar_number_engraver" } \context { \Score \remove "Bar_number_engraver"} \context {\Staff \context { \Staff \remove "Time_signature_engraver" \remove "Time_signature_engraver" } \remove "Bar_engraver" } } } { \key d \major \hideNotes c''1 \bar "|." { \key c \major \easyHeadsOn } \override Stem #'length = #0 g'4 }

\include "lilypond-book-preamble.ly" #(set-global-staff-size 20) \paper { #(define dump-extents #t) ragged-right = ##t line-width = 17\cm } \layout { indent = #0 \context { \Score \remove "Bar_number_engraver"} \context { \Staff \remove "Time_signature_engraver" \remove Staff_symbol_engraver \remove Clef_engraver } }

{ c'16 c'8 c'16 } Resources 1. Google search “lilypond” + whatever you want. It is extensively documented online, but finding your answer on their site is often faster with a Google search. 2. Lilypond.org and lilypondblog.org – both have extensive tutorials 3. Mutopia Project ( http://www.mutopiaproject.org/ ) is an on-line library of complete scores all created with Lilypond. All source Lilypond files and the generated PDF files are freely available to download and use.