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.

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.
Simple Things Are Simple
        Getting Started with LilyPond
You create a text file
WHAT YOU TYPE                WHAT YOU GET
into a text file   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 modified 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 flats 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 final 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 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).
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.
Difficult Things Are Possible
       Sonata India, Louis Calabro (1990)
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
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 files from media and
   specifications of all file 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 files
but not just object code.

More Related Content

Similar to You Can Print Music with LilyPond

VIM for (PHP) Programmers
VIM for (PHP) ProgrammersVIM for (PHP) Programmers
VIM for (PHP) ProgrammersZendCon
 
Advanced latex
Advanced latexAdvanced latex
Advanced latexawverret
 
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 .pdffazanmobiles
 
Ruby 程式語言簡介
Ruby 程式語言簡介Ruby 程式語言簡介
Ruby 程式語言簡介Wen-Tien Chang
 
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 PicklChristoph Pickl
 
Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9tomaspavelka
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101bokonen
 
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]
Ilfak Guilfanov - Decompiler internals: Microcode [rooted2018]RootedCON
 
New features in abap
New features in abapNew features in abap
New features in abapSrihari J
 
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 courseBiBcn
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxKenny (netman)
 

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 程式語言簡介
 
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
 
C Programming
C ProgrammingC Programming
C Programming
 
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
 
TheUnixPipeandFilters
TheUnixPipeandFiltersTheUnixPipeandFilters
TheUnixPipeandFilters
 
TheUnixPipeandFilters
TheUnixPipeandFiltersTheUnixPipeandFilters
TheUnixPipeandFilters
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

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.
  • 4. Simple Things Are Simple Getting Started with LilyPond
  • 5. You create a text file WHAT YOU TYPE WHAT YOU GET into a text file 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 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
  • 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 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.
  • 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 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.
  • 54. Difficult Things Are Possible Sonata India, Louis Calabro (1990)
  • 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
  • 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 files from media and specifications of all file 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 files 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