Examples#

The LilyPond documentation used in example can be downloaded here: /_scores/minuet-in-g.ly.

Original paper size#

\version "2.20.0"
\header {
  title = "Minuet in G major, BWV Anh. 114"
  composer = "Christian Petzold"
}

\score {
    <<
    \relative c'' {
      \time 3/4
      \tempo 4 = 120
      \key g \major

      d4 g,8 a b c
      d4 g, g
      e'4 c8 d e fis
      g4 g, g

      c4 d8 c b a
      b4 d8 c b a
      fis4 g8 a b g
      a2.
    }
    >>

    \midi {}
    \layout {}
}

.. lilyinclude:: /_scores/minuet-in-g.ly
   :nocrop:

Disable Audio#

\version "2.20.0"
\header {
  title = "Minuet in G major, BWV Anh. 114"
  composer = "Christian Petzold"
}

\score {
    <<
    \relative c'' {
      \time 3/4
      \tempo 4 = 120
      \key g \major

      d4 g,8 a b c
      d4 g, g
      e'4 c8 d e fis
      g4 g, g

      c4 d8 c b a
      b4 d8 c b a
      fis4 g8 a b g
      a2.
    }
    >>

    \midi {}
    \layout {}
}

.. lilyinclude:: /_scores/minuet-in-g.ly
   :noaudio:

Transposing#

\version "2.20.0"
\header {
  title = "Minuet in G major, BWV Anh. 114"
  composer = "Christian Petzold"
}

\score {
    <<
    \relative c'' {
      \time 3/4
      \tempo 4 = 120
      \key g \major

      d4 g,8 a b c
      d4 g, g
      e'4 c8 d e fis
      g4 g, g

      c4 d8 c b a
      b4 d8 c b a
      fis4 g8 a b g
      a2.
    }
    >>

    \midi {}
    \layout {}
}

.. lilyinclude:: /_scores/minuet-in-g.ly
   :transpose: g c

Multiple Pages#

\version "2.20.0"
\header {
  title = "Alice"
  composer = "古川本舖"
  arranger = "Osamuraisan"
  copyright = "SilverRainZ"
}

prelude = \repeat unfold 2 {
    e,4 c g d
    f, c g d
    g, c g d
    g,8(a,8\6) c4 g d
}

interlude = \repeat unfold 2 {
  <e, g>4 c' d' g'
  <f, g>4 c' d' g'
  <g, g>4 c' d' g'
  <f, g>4 c' d' g'
}

pieceA = {
  <a, c'>4 e' <e, g'> g
}

pieceAi = {
  <f, c'>4 g' <c g'> g
}

pieceB = {
  <c a'>4 g8 c'8 <f, c'>4 d
}

pieceBi = {
  <d g'>4 (c'') <a c''> g
}

pieceBii = {
  <c c'>4 d <g, d'> d'
}

pieceBiii = {
  <c c'>4 d <g, d'> f'
}

pieceC = {
  <c a>4 c' <g, e'> d
}

pieceCi = {
  <d c'>4 g <g, e'> g
}

pieceCii = {
  <c c'>4 d' <a, e'> g8 e'8
}

pieceCiii = {
  <d e'>4 c' <a, c'> g8 e'8
}

pieceCiv = {
  <c c'>4 d' <a, e'> g
}

pieceD = {
  <g, d'>4 c' <a, c'> g
}

pieceDi = {
  <g, d'>4 f' <a, e'> d
}

pieceDii = {
  <g, d'>4 d8 c'8 <a, c'>4 d8 e'8
}

pieceDiii = {
  <g, d'>4 c' <f, c'> g
}

pieceDiv = {
  <g, d'>4 d8 c'8 <a, c'>2
}

symbols =  {
  \time 4/4
  \tempo  "Allegro" 4 = 150

  % 1
  \prelude

  %9
  \pieceA
  \pieceB
  \pieceC
  \pieceD

  %13
  \pieceA
  \pieceB
  \pieceC
  \pieceDi

  %17
  \pieceA
  \pieceB
  \pieceC
  \pieceD

  %21
  \pieceA
  \pieceBi
  \pieceCi
  \pieceD

  %25
  \pieceA
  \pieceB
  <c a>4 c' <g, e'> <d f'>
  \pieceD

  %29
  \pieceA
  \pieceB
  \pieceC
  \pieceDi

  %33
  \pieceA
  \pieceB
  \pieceC
  \pieceD

  %37
  \pieceA
  \pieceBi
  \pieceCi
  \pieceDii

  \bar "||"

  %41
  \pieceDiii

  %42
  \pieceAi
  \pieceBii
  \pieceCii
  \pieceDiii

  %46
  \pieceAi
  \pieceBiii
  \pieceCiii
  \pieceDiii

  %50
  \pieceAi
  \pieceBiii
  \pieceCiv

  %53
  \pieceA
  \pieceBi
  \pieceCi
  \pieceDii

  \bar "||"

  %57
  \pieceA
  \pieceB
  \pieceC
  \pieceD

  %61
  \pieceA
  \pieceB
  \pieceC
  \pieceDi

  %65
  \pieceA
  \pieceB
  \pieceC
  \pieceD

  %69
  \pieceA
  \pieceBi
  \pieceCi
  \pieceDiv

  \bar "||"

  %73
  \prelude

  %81
  \interlude

  \bar "||"

  %89
  r1
  r1

  \bar "|."
}

\score {
  <<
    \new Staff \with {midiInstrument = "acoustic guitar (nylon)"} {
      \clef "G_8"
      \symbols
    }
    \new TabStaff {
      \tabFullNotation
      \symbols
    }
  >>

  \midi { }
  \layout { }
}

.. lilyinclude:: /_scores/alice.ly

Loop#

\version "2.20.0"
\header {
  title = "Minuet in G major, BWV Anh. 114"
  composer = "Christian Petzold"
}

\score {
    <<
    \relative c'' {
      \time 3/4
      \tempo 4 = 120
      \key g \major

      d4 g,8 a b c
      d4 g, g
      e'4 c8 d e fis
      g4 g, g

      c4 d8 c b a
      b4 d8 c b a
      fis4 g8 a b g
      a2.
    }
    >>

    \midi {}
    \layout {}
}

.. lilyinclude:: /_scores/minuet-in-g.ly
   :loop:

New in version 1.2.

Control Bar at the Top#

\version "2.20.0"
\header {
  title = "Minuet in G major, BWV Anh. 114"
  composer = "Christian Petzold"
}

\score {
    <<
    \relative c'' {
      \time 3/4
      \tempo 4 = 120
      \key g \major

      d4 g,8 a b c
      d4 g, g
      e'4 c8 d e fis
      g4 g, g

      c4 d8 c b a
      b4 d8 c b a
      fis4 g8 a b g
      a2.
    }
    >>

    \midi {}
    \layout {}
}

.. lilyinclude:: /_scores/minuet-in-g.ly
   :controls: top

New in version 1.3.

Jianpu (Numbered Musical Notation)#

\version "2.20.0"
#(set-global-staff-size 20)

% un-comment the next line to remove Lilypond tagline:
% \header { tagline="" }

\pointAndClickOff

\paper {
  print-all-headers = ##t %% allow per-score headers

  % un-comment the next line for A5:
  % #(set-default-paper-size "a5" )

  % un-comment the next line for no page numbers:
  % print-page-number = ##f

  % un-comment the next 3 lines for a binding edge:
  % two-sided = ##t
  % inner-margin = 20\mm
  % outer-margin = 10\mm

  % un-comment the next line for a more space-saving header layout:
  % scoreTitleMarkup = \markup { \center-column { \fill-line { \magnify #1.5 { \bold { \fromproperty #'header:dedication } } \magnify #1.5 { \bold { \fromproperty #'header:title } } \fromproperty #'header:composer } \fill-line { \fromproperty #'header:instrument \fromproperty #'header:subtitle \smaller{\fromproperty #'header:subsubtitle } } } }
}

%{ The jianpu-ly input was:
title=C Major Scale
1=C
4=60
2/4

1 2 3 4 5 6 7 1'
%}


\score {
<< \override Score.BarNumber #'break-visibility = #center-visible
\override Score.BarNumber #'Y-offset = -1
\set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)

%% === BEGIN JIANPU STAFF ===
    \new RhythmicStaff \with {
    \consists "Accidental_engraver" 
    %% Get rid of the stave but not the barlines:
    \override StaffSymbol #'line-count = #0 %% tested in 2.15.40, 2.16.2, 2.18.0, 2.18.2, 2.20.0 and 2.22.2
    \override BarLine #'bar-extent = #'(-2 . 2) %% LilyPond 2.18: please make barlines as high as the time signature even though we're on a RhythmicStaff (2.16 and 2.15 don't need this although its presence doesn't hurt; Issue 3685 seems to indicate they'll fix it post-2.18)
    }
    { \new Voice="W" {
    \override Beam #'transparent = ##f
    \override Stem #'direction = #DOWN
    \override Tie #'staff-position = #2.5
    \tupletUp
    \override Stem #'length-fraction = #0
    \override Beam #'beam-thickness = #0.1
    \override Beam #'length-fraction = #0.5
    \override Voice.Rest #'style = #'neomensural % this size tends to line up better (we'll override the appearance anyway)
    \override Accidental #'font-size = #-4
    \override TupletBracket #'bracket-visibility = ##t
\set Voice.chordChanges = ##t %% 2.19 bug workaround

    \override Staff.TimeSignature #'style = #'numbered
    \override Staff.Stem #'transparent = ##t
     \mark \markup{1=C} \tempo 4=60 \time 2/4 #(define (note-one grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (make-lower-markup 0.5 (make-bold-markup "1")))))))
  \applyOutput #'Voice #note-one c'4
#(define (note-two grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (make-lower-markup 0.5 (make-bold-markup "2")))))))
  \applyOutput #'Voice #note-two d'4
#(define (note-three grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (make-lower-markup 0.5 (make-bold-markup "3")))))))
| %{ bar 2: %}
  \applyOutput #'Voice #note-three e'4
#(define (note-four grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (make-lower-markup 0.5 (make-bold-markup "4")))))))
  \applyOutput #'Voice #note-four f'4
#(define (note-five grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (make-lower-markup 0.5 (make-bold-markup "5")))))))
| %{ bar 3: %}
  \applyOutput #'Voice #note-five g'4
#(define (note-six grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (make-lower-markup 0.5 (make-bold-markup "6")))))))
  \applyOutput #'Voice #note-six a'4
#(define (note-seven grob grob-origin context)
  (if (and (eq? (ly:context-property context 'chordChanges) #t)
      (or (grob::has-interface grob 'note-head-interface)
        (grob::has-interface grob 'rest-interface)))
    (begin
      (ly:grob-set-property! grob 'stencil
        (grob-interpret-markup grob
          (make-lower-markup 0.5 (make-bold-markup "7")))))))
| %{ bar 4: %}
  \applyOutput #'Voice #note-seven b'4
  \applyOutput #'Voice #note-one c''4^. \bar "|." } }
% === END JIANPU STAFF ===

>>
\header{
title="C Major Scale"
}
\layout{} }
\score {
\unfoldRepeats
<< 

% === BEGIN MIDI STAFF ===
    \new Staff { \new Voice="X" { \transpose c c { \key c \major  \tempo 4=60 \time 2/4 c'4 d'4 | %{ bar 2: %} e'4 f'4 | %{ bar 3: %} g'4 a'4 | %{ bar 4: %} b'4 c''4 } } }
% === END MIDI STAFF ===

>>
\header{
title="C Major Scale"
}
\midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 84 4)}} }

.. jianpu::

   title=C Major Scale
   1=C
   4=60
   2/4

   1 2 3 4 5 6 7 1'

New in version 1.5.