SlideShare a Scribd company logo
1 of 81
You can print music with
              LilyPond!
               John David Duncan
          joh.duncan@oracle.com
GNU LilyPond
 Software for engraving music

http://www.lilypond.org

Binaries for Linux, Mac, Windows
Agenda
Simple Things Are Simple
  GETTING STARTED. 15 MIN.

The LilyPond design
  COMPARED TO SOME OTHER SOFTWARE. 10 MIN.

Difļ¬cult 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.
Simple Things Are Simple
        Getting Started with LilyPond
You create a text ļ¬le
WHAT YOU TYPE                WHAT YOU GET
into a text ļ¬le   compiled    as a PDF
                      by
                  LilyPond
    { g }
... containing music expressions.
   WHAT YOU TYPE              WHAT YOU GET
Begin a            pitch
music expression

      { g }


             End expression
The backslash begins commands      *


  WHAT YOU TYPE       WHAT YOU GET

command    argument

{ clef bass c }



                            * like   TEX
An Extended Music Expression
  WHAT YOU TYPE      WHAT YOU GET




{ clef bass c d }
Nested Music Expressions
     WHAT YOU TYPE       WHAT YOU GET



{
    clef bass
     c { d }
}
Pitches can be modiļ¬ed with accents
     WHAT YOU TYPE       WHAT YOU GET



{
    clef bass
    c->
}
... and other articulation marks.
     WHAT YOU TYPE         WHAT YOU GET



{
    clef bass
    c-. d-- e->
}
You can type ļ¬‚ats and sharps
               in Dutch...
    WHAT YOU TYPE       WHAT YOU GET



{
    clef bass
    ees fis g
}
or you can change the language.
    WHAT YOU TYPE        WHAT YOU GET

language english

{
    clef bass
    ef fs g
}
Octaves: ' is up and , is down
  WHAT YOU TYPE       WHAT YOU GET

{
clef bass
  c, c c'

clef treble
  c' c'' c'''
}
Simultaneous music expessions
    are enclosed in << ...  ... >>
  WHAT YOU TYPE          WHAT YOU GET

{
clef bass
  <<
   { a b c' } 
   { d g c }
  >>
}
Chords in one voice can use < >.
  WHAT YOU TYPE        WHAT YOU GET


{
clef bass
<d f> <g b> <c c'>
}
Set the meter with time
    WHAT YOU TYPE          WHAT YOU GET



{
                       3
    time 3/4
    g' d'' d''
                       4
    g d'' d''
}
Bar lines: | and bar
    WHAT YOU TYPE              WHAT YOU GET
{
    time 3/4
    g' d'' d'' |
    g d'' d'' bar "||"
}

                           3
                           4
These are not complete scores,
but LilyPond has been providing
 an implicit document structure.
The previous example, expanded

book {
  score {
    new Staff {
      new Voice {
          time 3/4 g' d'' d'' | g   d'' d''
        }
    }
    layout { }
  }
}
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.            |
}
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
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
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
}
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
      }
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
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
Explicit repeats

jig = { time 6/8
	 	 	    secA secA
	 	      secB secB
      }
6             Volta Repeats
8               ITALIAN FOR ā€œTIMESā€
    jig = { time 6/8
    	 	 	    repeat volta 2 secA
    	 	      repeat volta 2 secB


        6
          }


        8
Volta Repeat with 1st & 2nd endings


 jig = { time 6/8
 	 	 	 repeat volta 2 secA
           alternative
           {
               { aEndingOne }
               { aEndingTwo }
           }
         repeat volta 2 secB
       }
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.
Add a Header and Staff

header {
	 title = "The Connaughtman's Rambles "
	 composer = "Traditional Irish"
}



score {
   new Staff {   jig   }
   layout { }
}
The ļ¬nal product
          The Connaughtman's Rambles
                                     Traditional Irish

          6
          8
5                               1.



     2.
9




13
Printed for Shape Note Singers
score {
   new Staff {
     southernHarmonyHeads
     jig
   }
   layout { }
      The Connaughtman's     Rambles
}                                    Traditio

     6
     8
                                1.
... or Medieval Monks
score {
   new VaticanaStaff
    { transpose c' c { jig         } }

The Connaughtman's Rambles
 layout { }
}                              Traditional Irish
                                1.         2.
The LilyPond Design
Compared to Finale, Sibelius, MusixTeX, ABC
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)
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.
Design Features

1.The ly language is the User Interface*




                               * Like SQL
The database UI
       THIS IS A USER INTERFACE




SELECT * FROM users
WHERE last_name like ā€˜Duncanā€™;
The LilyPond UI
THIS IS A USER INTERFACE




       { g }
Lilypond vs. MusicXML (1)
               THIS IS AN OPEN FILE FORMAT
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE score-partwise PUBLIC
    "-//Recordare//DTD MusicXML 3.0 Partwise//EN"
    "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="3.0">
  <part-list>
    <score-part id="P1">
      <part-name>Music</part-name>
    </score-part>
  </part-list>
  <part id="P1">
    <measure number="1">
      <attributes>
        <divisions>1</divisions>
        <key>
          <fifths>0</fifths>
        </key>
Lilypond vs. MusicXML (2)
        <time>
          <beats>4</beats>
          <beat-type>4</beat-type>
        </time>
        <clef>
          <sign>G</sign>
          <line>2</line>
        </clef>
      </attributes>
      <note>
        <pitch>
          <step>G</step>
          <octave>4</octave>
        </pitch>
        <duration>1</duration>
        <type>quarter</type>
      </note>
    </measure>
  </part>
</score-partwise>
Graphical Front End Apps
    e.g. Frescobaldi
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.
Design Features

1.The language is the User Interface
2.Musical content is distinct from layout
  and rendering
Musical Content is Distinct from
        Layout and Rendering
{    tempo 4=96 clef bass
     c'32->[ ( df' c' df']    b8.->   )   }



       Engravers              Performers


       = 96
Musical Content is Distinct from
        Layout and Rendering
{    tempo 4=96 clef bass
     c'32->[ ( df' c' df']    b8.->   )   }



       Engravers              Performers


       = 96
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
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
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
Musical Content is Distinct from
              Layout and Rendering
f MusiXTEX
      describe layout (albeit economically).
  input ļ¬le
   ABC
EX ļ¬le a MusiXTEX ļ¬le? music in a very simple
                describe
s a special kind of TEX input ļ¬le. 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).
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.
Difļ¬cult Things Are Possible
       Sonata India, Louis Calabro (1990)
Difļ¬cult 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
The Composer
Original Handwritten Score
   and Printed cello part
Quarter Tones for Cello
Double Stops & Harmonics
Unusual Notation
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] }
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
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} |
Original Printed Cello Part
Original Printed Cello Part

                          for DOS (1987)
                          or Mac (1989)
ā€œDeluxe Music
 Construction
 Setā€ for Mac
   and Amiga
  (EA, 1986)*
                              a font
Wikipedia on DMCS:
Dependency Analysis

DMCS edition:
   Original hardware or emulators and copies of
   the software used to produce the edition
   or hardware to read the ļ¬les from media and
   speciļ¬cations of all ļ¬le formats.
LilyPond edition:
   LilyPond
      Guile, FreeType, Ghostscript, Python, etc ...
         C and C++ compilers (gcc)
Conclusions
on music, source code, object code, and engineering
Some Technological History of Music



Modern Notation

                     Recording

                              Computers

1700      1800       1900        2000
Composer / Publisher Eras



Composerā€™s handwritten manuscript
or publisherā€™s commercial engraving

                        Composerā€™s digital edition


1700                  1985     2000
ā€œ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
Engineering



An engineer designs something by means
of producing a document which others
can use to create the thing.
Source Code


Souce code is a document that can be
  stored,
  transmitted,
  and used to produce a particular
  software artifact.
Object Code



is a sequence of computer instructions
for a particular machine
and is not human-readable.
Composition



A composer writes music by means of
producing a score which others can use
to perform the music.
Musical Scores


A musical score is a document that can be
  stored,
  transmitted,
  and used to produce a particular
  musical artifact.
The full cycle


Source   Software Artifact /   Performance
 Code          Score

{ g }
The abridged cycle


Source     Software Artifact /   Computer



              X
 Code            Score         ā€œPerformanceā€

{ g }
The abridged cycle


Source     Software Artifact /   Computer



              X
 Code            Score         ā€œPerformanceā€

{ g }
This is source code!

% Measure 33. TODO: Ties in LH
piano clef treble
	 << { df''2. }  { af'32 ( g') af'8.~ af'2 } >>
	 times 2/3 { lh c'32 [ ( df' g' }
	 times 2/3 { rh c'' df'' g'' ] }
	 times 2/3 { rh af''~ g''~ df''~ ] }
	 times 2/3 { rh c''~ lh g' df' ) }    |
s1 |
<< { stemDown tieDown c,4 c,4~ c,4 }  { stemUp
tieUp c8 [ g,16 g,] c,8 [ g, ]~ g,4 } >>
	 clef treble s4 |
s1 |
Ultimately


Whoever creates digital today media
should strive to produce source code
or standard vendor-neutral ļ¬les
but not just object code.

More Related Content

Similar to You Can Print Music with LilyPond

Vim For Php
Vim For PhpVim For Php
Vim For Php
Liu Lizhi
Ā 
Many of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdfMany of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdf
fazanmobiles
Ā 
Ruby ē؋式čŖžč؀ē°”介
Ruby ē؋式čŖžč؀ē°”介Ruby ē؋式čŖžč؀ē°”介
Ruby ē؋式čŖžč؀ē°”介
Wen-Tien Chang
Ā 
Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
tomaspavelka
Ā 
4th presentation of the BiB LaTeX course
4th presentation of the BiB LaTeX course4th presentation of the BiB LaTeX course
4th presentation of the BiB LaTeX course
BiBcn
Ā 

Similar to You Can Print Music with LilyPond (20)

VIM for (PHP) Programmers
VIM for (PHP) ProgrammersVIM for (PHP) Programmers
VIM for (PHP) Programmers
Ā 
Perl Presentation
Perl PresentationPerl Presentation
Perl Presentation
Ā 
Vim For Php
Vim For PhpVim For Php
Vim For Php
Ā 
Advanced latex
Advanced latexAdvanced latex
Advanced latex
Ā 
Paexec -- distributed tasks over network or cpus
Paexec -- distributed tasks over network or cpusPaexec -- distributed tasks over network or cpus
Paexec -- distributed tasks over network or cpus
Ā 
Many of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdfMany of us have large digital music collections that are not always .pdf
Many of us have large digital music collections that are not always .pdf
Ā 
Ruby ē؋式čŖžč؀ē°”介
Ruby ē؋式čŖžč؀ē°”介Ruby ē؋式čŖžč؀ē°”介
Ruby ē؋式čŖžč؀ē°”介
Ā 
Fun never stops. introduction to haskell programming language
Fun never stops. introduction to haskell programming languageFun never stops. introduction to haskell programming language
Fun never stops. introduction to haskell programming language
Ā 
JSUG - The Sound of Shopping by Christoph Pickl
JSUG - The Sound of Shopping by Christoph PicklJSUG - The Sound of Shopping by Christoph Pickl
JSUG - The Sound of Shopping by Christoph Pickl
Ā 
Melody harmonizer
Melody harmonizerMelody harmonizer
Melody harmonizer
Ā 
I35s
I35sI35s
I35s
Ā 
n
nn
n
Ā 
Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
Ā 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101
Ā 
Functional Programming in JAVA 8
Functional Programming in JAVA 8Functional Programming in JAVA 8
Functional Programming in JAVA 8
Ā 
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ā 
New features in abap
New features in abapNew features in abap
New features in abap
Ā 
4th presentation of the BiB LaTeX course
4th presentation of the BiB LaTeX course4th presentation of the BiB LaTeX course
4th presentation of the BiB LaTeX course
Ā 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
Ā 
Lecture 3 RE NFA DFA
Lecture 3   RE NFA DFA Lecture 3   RE NFA DFA
Lecture 3 RE NFA DFA
Ā 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(ā˜Žļø+971_581248768%)**%*]'#abortion pills for sale in dubai@
Ā 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Ā 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Ā 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
Ā 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Ā 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Ā 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Ā 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Ā 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Ā 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
Ā 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Ā 

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. Difļ¬cult 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.
  • 4. Simple Things Are Simple Getting Started with LilyPond
  • 5. You create a text ļ¬le WHAT YOU TYPE WHAT YOU GET into a text ļ¬le compiled as a PDF by LilyPond { g }
  • 6. ... containing music expressions. WHAT YOU TYPE WHAT YOU GET Begin a pitch music expression { g } End expression
  • 7. The backslash begins commands * WHAT YOU TYPE WHAT YOU GET command argument { clef bass c } * like TEX
  • 8. An Extended Music Expression WHAT YOU TYPE WHAT YOU GET { clef bass c d }
  • 9. Nested Music Expressions WHAT YOU TYPE WHAT YOU GET { clef bass c { d } }
  • 10. Pitches can be modiļ¬ed 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 ļ¬‚ats 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
  • 28. Explicit repeats jig = { time 6/8 secA secA secB secB }
  • 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 ļ¬nal 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.
  • 36. The LilyPond Design Compared to Finale, Sibelius, MusixTeX, ABC
  • 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.
  • 39. Design Features 1.The ly language is the User Interface* * Like SQL
  • 40. The database UI THIS IS A USER INTERFACE SELECT * FROM users WHERE last_name like ā€˜Duncanā€™;
  • 41. The LilyPond UI THIS IS A USER INTERFACE { g }
  • 42. Lilypond vs. MusicXML (1) THIS IS AN OPEN FILE FORMAT <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd"> <score-partwise version="3.0"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>1</divisions> <key> <fifths>0</fifths> </key>
  • 43. Lilypond vs. MusicXML (2) <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> </measure> </part> </score-partwise>
  • 44. Graphical Front End Apps e.g. Frescobaldi
  • 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.
  • 46. Design Features 1.The language is the User Interface 2.Musical content is distinct from layout and rendering
  • 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 ļ¬le ABC EX ļ¬le a MusiXTEX ļ¬le? music in a very simple describe s a special kind of TEX input ļ¬le. 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.
  • 54. Difļ¬cult Things Are Possible Sonata India, Louis Calabro (1990)
  • 55. Difļ¬cult 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
  • 57. Original Handwritten Score and Printed cello part
  • 59. Double Stops & Harmonics
  • 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} |
  • 65. Original Printed Cello Part for DOS (1987) or Mac (1989) ā€œDeluxe Music Construction Setā€ for Mac and Amiga (EA, 1986)* a font
  • 67. Dependency Analysis DMCS edition: Original hardware or emulators and copies of the software used to produce the edition or hardware to read the ļ¬les from media and speciļ¬cations of all ļ¬le formats. LilyPond edition: LilyPond Guile, FreeType, Ghostscript, Python, etc ... C and C++ compilers (gcc)
  • 68. Conclusions on music, source code, object code, and engineering
  • 69. Some Technological History of Music Modern Notation Recording Computers 1700 1800 1900 2000
  • 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
  • 72. Engineering An engineer designs something by means of producing a document which others can use to create the thing.
  • 73. Source Code Souce code is a document that can be stored, transmitted, and used to produce a particular software artifact.
  • 74. Object Code is a sequence of computer instructions for a particular machine and is not human-readable.
  • 75. Composition A composer writes music by means of producing a score which others can use to perform the music.
  • 76. Musical Scores A musical score is a document that can be stored, transmitted, and used to produce a particular musical artifact.
  • 77. The full cycle Source Software Artifact / Performance Code Score { g }
  • 78. The abridged cycle Source Software Artifact / Computer X Code Score ā€œPerformanceā€ { g }
  • 79. The abridged cycle Source Software Artifact / Computer X Code Score ā€œPerformanceā€ { g }
  • 80. This is source code! % Measure 33. TODO: Ties in LH piano clef treble << { df''2. } { af'32 ( g') af'8.~ af'2 } >> times 2/3 { lh c'32 [ ( df' g' } times 2/3 { rh c'' df'' g'' ] } times 2/3 { rh af''~ g''~ df''~ ] } times 2/3 { rh c''~ lh g' df' ) } | s1 | << { stemDown tieDown c,4 c,4~ c,4 } { stemUp tieUp c8 [ g,16 g,] c,8 [ g, ]~ g,4 } >> clef treble s4 | s1 |
  • 81. Ultimately Whoever creates digital today media should strive to produce source code or standard vendor-neutral ļ¬les but not just object code.

Editor's Notes

  1. Play &amp;#x201C;Sonata India&amp;#x201D; recording as people enter\n\n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. make this a g\n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. Opening brackets are placed after the first note. Beams, slurs, and phrases do not follow the usual rules of nesting. \n
  25. Still introducing concepts, but also making some music....\n
  26. \n
  27. \n
  28. \n
  29. \n
  30. The first ending of the A section leads you back to the beginning; the second ending leads you into the B section ...\n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. Sibelius is probably the &amp;#x201C;category leader&amp;#x201D;.\n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. 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
  53. \n
  54. Everyone should agree that these two traits together should make almost anything possible. \n
  55. \n
  56. \n
  57. Along with an idiosyncratic notation for them.\n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. Let&amp;#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
  67. \n
  68. \n
  69. \n
  70. Zooming in on 1980 - 2010. A real Babel.\n
  71. \n
  72. stored on a file server.\ntransmitted over the internet.\n
  73. stored on a file server.\ntransmitted over the internet.\n
  74. \n
  75. stored in a music library.\ntransmitted in the mail.\n
  76. \n
  77. \n
  78. \n
  79. \n