TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
You Can Print Music with LilyPond
1. You can print music with
LilyPond!
John David Duncan
joh.duncan@oracle.com
2. GNU LilyPond
Software for engraving music
http://www.lilypond.org
Binaries for Linux, Mac, Windows
3. Agenda
Simple Things Are Simple
GETTING STARTED. 15 MIN.
The LilyPond design
COMPARED TO SOME OTHER SOFTWARE. 10 MIN.
Difficult Things Are Possible
SONATA INDIA (LOUIS CALABRO, 1990). 10 MIN.
Conclusions on music, source code, object
code, and principles of engineering
A LITTLE PHILOSOPHY. 5 MIN.
10. Pitches can be modified with accents
WHAT YOU TYPE WHAT YOU GET
{
clef bass
c->
}
11. ... and other articulation marks.
WHAT YOU TYPE WHAT YOU GET
{
clef bass
c-. d-- e->
}
12. You can type flats and sharps
in Dutch...
WHAT YOU TYPE WHAT YOU GET
{
clef bass
ees fis g
}
13. or you can change the language.
WHAT YOU TYPE WHAT YOU GET
language english
{
clef bass
ef fs g
}
14. Octaves: ' is up and , is down
WHAT YOU TYPE WHAT YOU GET
{
clef bass
c, c c'
clef treble
c' c'' c'''
}
15. Simultaneous music expessions
are enclosed in << ... ... >>
WHAT YOU TYPE WHAT YOU GET
{
clef bass
<<
{ a b c' }
{ d g c }
>>
}
16. Chords in one voice can use < >.
WHAT YOU TYPE WHAT YOU GET
{
clef bass
<d f> <g b> <c c'>
}
17. Set the meter with time
WHAT YOU TYPE WHAT YOU GET
{
3
time 3/4
g' d'' d''
4
g d'' d''
}
18. Bar lines: | and bar
WHAT YOU TYPE WHAT YOU GET
{
time 3/4
g' d'' d'' |
g d'' d'' bar "||"
}
3
4
19. These are not complete scores,
but LilyPond has been providing
an implicit document structure.
20. The previous example, expanded
book {
score {
new Staff {
new Voice {
time 3/4 g' d'' d'' | g d'' d''
}
}
layout { }
}
}
21. Rhythm: notes with durations
WHAT YOU TYPE WHAT YOU GET
{
time 3/4
g4 a4 b4 |
3
c'8 b8 a2 | 4
b2 b4 |
c'2. |
}
22. Durations are “sticky” until changed.
WHAT YOU TYPE WHAT YOU GET
language english
{
time 3/4
g4 a b |
c'8 d' e' fs' g' a' |
g'2. | g' |
} 3
4
23. Relative Pitch Mode
IT CAN SAVE TYPING SOME OCTAVE MARKERS.
WHAT YOU TYPE WHAT YOU GET
language english
relative c'
{
time 3/4
g4 a b | c8 d e fs g a |
g2. | g |
}
3
4
24. Beams [ ] and Slurs ( )
WHAT YOU TYPE WHAT YOU GET
relative c’
{
time 3/4
3
d8 [ ( f f ] 4
f [ e f ] )
g4 e4 c4
}
25. We’re ready for a jig
BUT BECAUSE WE’RE PROGRAMMERS,
WE ARE GOING TO ASSIGN IT TO SOME VARIABLES.
jig = { time 6/8
secA secA
secB secB
}
26. A Section
secA = relative c'' {
e8 g-. g-. c g-. g-. |
a g a c g f |
e g-. g-. c e d |
c a a a g f |
e g-. g-. c g-. g-. |
a g a c d e |
f e d e4trill d8 |
c a a a-. g [Connaughtman's Rambles
The ( f)] |
}
6
8
27. an's Rambles
B Section Irish
Traditional
secB = relative c'' {
e8 a a e g g |
e d e c d f |
e a a e g g |
e d c d4 f8 |
e8 a a e g g |
e d e c d f |
f e d e4trill d8 |
c a a a4.
}
6
8
29. 6 Volta Repeats
8 ITALIAN FOR “TIMES”
jig = { time 6/8
repeat volta 2 secA
repeat volta 2 secB
6
}
8
30. Volta Repeat with 1st & 2nd endings
jig = { time 6/8
repeat volta 2 secA
alternative
{
{ aEndingOne }
{ aEndingTwo }
}
repeat volta 2 secB
}
31. A section: 1st & 2nd endings
aEndingOne = relative c''
{ c a a a-. g [ ( f)] }
The Connaughtman's Rambles
aEndingTwo = relative c''
6 { c a a a4 f'8 }
8
1. 2.
32. Add a Header and Staff
header {
title = "The Connaughtman's Rambles "
composer = "Traditional Irish"
}
score {
new Staff { jig }
layout { }
}
33. The final product
The Connaughtman's Rambles
Traditional Irish
6
8
5 1.
2.
9
13
34. Printed for Shape Note Singers
score {
new Staff {
southernHarmonyHeads
jig
}
layout { }
The Connaughtman's Rambles
} Traditio
6
8
1.
35. ... or Medieval Monks
score {
new VaticanaStaff
{ transpose c' c { jig } }
The Connaughtman's Rambles
layout { }
} Traditional Irish
1. 2.
37. Sibelius
$600 for Mac or Windows
Can integrate with other Avid products:
DigiDesign Pro Tools
M-Audio hardware
Scorch reader app for iPad
PhotoScore (Musical OCR)
AudioScore (Automatic Transcription)
38. Sibelius / Finale UI Style
THIS IS A USER INTERFACE
Graphical desktop
applications in a
style similar to
Microsoft Word and
Adobe Photoshop,
which also allow the
use of a MIDI
controller to enter
notes.
45. Graphical Front End Apps
e.g. Frescobaldi
Main weakness: LilyPond is designed
to render whole scores (slowly), but
not to allow editing and quick
rendering of just the portion of the
score in the active window.
47. Musical Content is Distinct from
Layout and Rendering
{ tempo 4=96 clef bass
c'32->[ ( df' c' df'] b8.-> ) }
Engravers Performers
= 96
48. Musical Content is Distinct from
Layout and Rendering
{ tempo 4=96 clef bass
c'32->[ ( df' c' df'] b8.-> ) }
Engravers Performers
= 96
49. Musical Content is Distinct from
Layout and Rendering
{ tempo 4=96 clef bass
c'32->[ ( df' c' df'] b8.-> ) }
Rendered by a
Ignored
Clef_engraver
= 96
50. Musical Content is Distinct from
Layout and Rendering
{ tempo 4=96 clef bass
c'32->[ ( df' c' df'] b8.-> ) }
Metronome_mark_engraver Tempo_performer
= 96
51. Musical Content is Distinct from
Layout and Rendering
{ tempo 4=96 clef bass
c'32->[ ( df' c' df'] b8.-> ) }
NoteEvent
Suppressed accidental Note_performer
= 96
52. Musical Content is Distinct from
Layout and Rendering
f MusiXTEX
describe layout (albeit economically).
input file
ABC
EX file a MusiXTEX file? music in a very simple
describe
s a special kind of TEX input file. What makes it special is that it
language.
input musixtex before any reference to MusiXTEX macros. Af-
t musixadd or input musixmad if you want to have respectively
ments or simultaneous beams, ties, or slurs. If you want to have
LilyPond
ments, you can assign them directly by including one or more of these
describes music in a simple but
ents, setmaxcxxviiibeams, setmaxcclvibeams, setmaxgroups,
ls, setmaxoctlines.
powerful language & engrave it
e, after that, if you wished to, you could write a whole non-musical
mands provided that you did not use & as a tab character like in plain
beautifully.
ode has been changed).
53. Design Features
1.The language is the User Interface.
2.Musical content is distinct from layout
and rendering.
3. The developers are irrationally
obsessed with producing the most
beautiful output possible.
55. Difficult Things Are Possible
Any glyph can be replaced by custom
PostScript code
Any parameter used in layout can be
replaced by the output of a custom
function written in Scheme
61. The pianist also plays drums
3
= 80
pp
% Measure 20 Tabla or bongos (pitch important)
tempo 8=80
bongos
drone
repeat percent 2 una corda
{ acciaccatura{ c16[ c]} c8 [ g16 g]c8[ g8]
acciaccatura{ c16[ c]} c8 [ g16 g]c8[ g8] }
62. Rhythms are split between left
and right hand piano parts
3
3
3 4
3 3
3
3
4
% Measure 33. TODO: Ties in LH
piano clef treble = 92
4
5 Piu Mosso
override PhrasingSlur #'height-limit = #'15
4
times 2/3 { lh c'32 3[ ( df' g' }
times 2/3 { rh c'' df'' g'' ] }
3 p
63. Rhythms are split between left
3 3 3
3 3
and right hand piano parts
3
3 3 3
3 3 3
lh <af, df f>16 rh <g c' e'> q
lh <af, df f> rh <g c' e'> q
lh <af, df f> rh <gp c' e'>
bongos c8[ g16 g] c8[ g] piano |Crescendo
s2 repeat tremolo 8 { <c, g, c>16} |
67. Dependency Analysis
DMCS edition:
Original hardware or emulators and copies of
the software used to produce the edition
or hardware to read the files from media and
specifications of all file formats.
LilyPond edition:
LilyPond
Guile, FreeType, Ghostscript, Python, etc ...
C and C++ compilers (gcc)
70. Composer / Publisher Eras
Composer’s handwritten manuscript
or publisher’s commercial engraving
Composer’s digital edition
1700 1985 2000
71. “Score Archaeology”
(a subset)
Apple II, Amiga, Mac
DMCS
1.0 (Mac) 1.5 (Mac/Win)
ConcertWare
Igor Engraver
1.0 2.0 3.0 2005 2007
Finale
Acorn Windows & Mac
Sibelius
1.0 2.0
LilyPond
1.0 1.1 2.0 3.0
MusicXML
1980 1990 2000 2010
81. Ultimately
Whoever creates digital today media
should strive to produce source code
or standard vendor-neutral files
but not just object code.
Editor's Notes
Play &#x201C;Sonata India&#x201D; recording as people enter\n\n
\n
\n
\n
\n
\n
make this a g\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Opening brackets are placed after the first note. Beams, slurs, and phrases do not follow the usual rules of nesting. \n
Still introducing concepts, but also making some music....\n
\n
\n
\n
\n
The first ending of the A section leads you back to the beginning; the second ending leads you into the B section ...\n
\n
\n
\n
\n
\n
\n
Sibelius is probably the &#x201C;category leader&#x201D;.\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Use the best German music engraving from the 1950s as a standard (Barenreiter Bach Cello Suites) and try to match it with the default algorithms.\n
\n
Everyone should agree that these two traits together should make almost anything possible. \n
\n
\n
Along with an idiosyncratic notation for them.\n
\n
\n
\n
\n
\n
\n
\n
\n
Let&#x2019;s go another 20 years into the future and try to work with the LilyPond score.\nMany components are required to build LilyPond: specific fonts, and specific versions of FontConfig, FreeType, Ghostscript, Guile, Pango, Python, Perl, Flex, Bison, GetText, Make, MetaFont, and TexInfo. \nBut ultimately they all depend on gcc. Looking back, if I had something from 20 years ago that ultimately only depended on gcc, I would be in good shape.\n\n\n
\n
\n
\n
Zooming in on 1980 - 2010. A real Babel.\n
\n
stored on a file server.\ntransmitted over the internet.\n
stored on a file server.\ntransmitted over the internet.\n
\n
stored in a music library.\ntransmitted in the mail.\n