Footnotes in music expressions

Music footnotes overview

Footnotes in music expressions fall into two categories:

Event-based footnotes

are attached to a particular event. Examples for such events are single notes, articulations (like fingering indications, accents, dynamics), and post-events (like slurs and manual beams). The general form for event-based footnotes is as follows:

[direction] \footnote [mark] offset footnote music
Time-based footnotes

are bound to a particular point of time in a musical context. Some commands like \time and \clef don’t actually use events for creating objects like time signatures and clefs. Neither does a chord create an event of its own: its stem or flag is created at the end of a time step (nominally through one of the note events inside). Exactly which of a chord’s multiple note events will be deemed the root cause of a stem or flag is undefined. So for annotating those, time-based footnotes are preferable as well.

A time-based footnote allows such layout objects to be annotated without referring to an event. The general form for time-based footnotes is:

\footnote [mark] offset footnote [Context].GrobName

The elements for both forms are:

direction

If (and only if) the \footnote is being applied to a post-event or articulation, it must be preceded with a direction indicator (‘-’, ‘_’, ‘^’) in order to attach music (with a footnote mark) to the preceding note or rest.

mark

is a markup or string specifying the footnote mark which is used for marking both the reference point and the footnote itself at the bottom of the page. It may be omitted (or equivalently replaced with \default) in which case a number in sequence will be generated automatically. By default, such numerical sequences restart on each page containing a footnote. Footnotes may be numbered consecutively across page beaks by setting the variable reset-footnotes-on-new-page to #f, see \paper variables concerning headers and markups.

offset

is a number pair such as ‘#(2 . 1)’ specifying the X and Y offsets in units of staff spaces from the boundary of the object where the mark should be placed. Positive values of the offsets are taken from the right/top edge, negative values from the left/bottom edge and zero implies the mark is centered on the edge.

Context

is the context in which the grob being footnoted is created. It may be omitted if the grob is in a bottom context, e.g., a Voice context.

GrobName

specifies a type of grob to mark (like ‘Flag’). If it is specified, the footnote is not attached to a music expression in particular, but rather to all grobs of the type specified which occur at that moment of musical time.

footnote

is the markup or string specifying the footnote text to use at the bottom of the page.

music

is the music event or post-event or articulation that is being annotated.

Event-based footnotes

A footnote may be attached to a layout object directly caused by the event corresponding to music with the syntax:

\footnote [mark] offset footnote music
\book {
  \header { tagline = ##f }
  \markup "event-based footnotes"
  \markup \null
  \relative c'' {
    \footnote #'(-1 . 3) "A note." a4
    a4
    \footnote #'(2 . 2) "A rest." r4
    a4
  }
}

[image of music]

If a chord is marked with an event-based footnote, each chord note gets a separate but identical footnote, which is undesired normally. However, it is possible to create footnotes for individual notes inside of a chord.

\book {
  \header { tagline = ##f }
  \markup "event-based footnotes"
  \markup \null
  \relative c'' {
    \footnote #'(1 . 3) "A chord." <a-3 c-5>2
    <a-3 \footnote #'(3 . 0.5) "A note in a chord." c-5>4
  }
}

[image of music]

If the footnote is to be attached to a post-event or articulation the \footnote command must be preceded by a direction indicator (‘-’, ‘_’, ‘^’), and followed by the post-event or articulation to be annotated as the music argument. In this form the \footnote can be considered to be simply a copy of its last argument with a footnote mark attached to it. The syntax is:

direction \footnote [mark] offset footnote music
\book {
  \header { tagline = ##f }
  \markup "event-based footnotes"
  \markup \null
  \relative {
    a'4_\footnote #'(0 . -1) "A slur forced down." (
    b8^\footnote #'(1 . 0.5) "A manual beam forced up." [
    b8 ]
    c4 )
    c-\footnote #'(1 . 1) "Tenuto." --
  }
}

[image of music]

Time-based footnotes

If the layout object being footmarked is indirectly caused by an event (like an Accidental or Stem caused by a NoteHead event), the GrobName of the layout object is required after the footnote text instead of music:

\book {
  \header { tagline = ##f }
  \markup "time-based footnotes"
  \markup \null
  \relative c'' {
    \footnote #'(-1 . -3) "A flat." Accidental
    aes4 c
    \footnote #'(-1 . 0.5) "Another flat." Accidental
    ees
    \footnote #'(1 . -2) "A stem." Stem
    aes
  }
}

[image of music]

Note, however, that when a GrobName is specified, a footnote is attached to all grobs of that type at the current time step:

\book {
  \header { tagline = ##f }
  \markup "time-based footnotes"
  \markup \null
  \markup \null
  \relative c' {
    \footnote #'(-1 . 3) "A flat." Accidental
    <ees ges bes>4
    \footnote #'(2 . 0.5) "Articulation." Script
    c'->-.
  }
}

[image of music]

A note inside of a chord can be given an individual (event-based) footnote. A ‘NoteHead’ is the only grob directly caused from a chord note, so an event-based footnote command is only suitable for adding a footnote to the ‘NoteHead’ within a chord. All other chord note grobs are indirectly caused. The \footnote command itself offers no syntax for specifying both a particular grob type as well as a particular event to attach to. However, one can use a time-based \footnote command for specifying the grob type, and then prefix this command with \single in order to have it applied to just the following event:

\book {
  \header { tagline = ##f }
  \markup "time-based footnotes"
  \markup \null
  \relative c'' {
    < \footnote #'(1 . -2) "An A." a
      \single \footnote #'(-1 . -1) "A sharp." Accidental
      cis
      \single \footnote #'(0.5 . 0.5) "A flat." Accidental
      ees fis
    >2
  }
}

[image of music]

Note: When footnotes are attached to several musical elements at the same musical moment, as they are in the example above, the footnotes are numbered from the higher to the lower elements as they appear in the printed output, not in the order in which they are written in the input stream.

Layout objects like clefs and key change signatures are mostly caused as a consequence of changed properties rather than actual events. Others, like bar lines and bar numbers, are a direct consequence of timing. For this reason, footnotes on such objects have to be based on their musical timing. Time-based footnotes are also preferable when marking features like stems and beams on chords: while such per-chord features are nominally assigned to one event inside the chord, relying on a particular choice would be imprudent.

The layout object in question must always be explicitly specified for time-based footnotes, and the appropriate context must be specified if the grob is created in a context other than the bottom context.

\book {
  \header { tagline = ##f }
  \markup "time-based footnotes"
  \relative c'' {
    r1 |
    \footnote #'(-0.5 . -1) "Meter change." Staff.TimeSignature
    \time 3/4
    \footnote #'(1 . -1) "Chord stem." Stem
    <c e g>4 q q
    \footnote #'(-0.5 . 2) "Bar line." Staff.BarLine
    q q
    \footnote #'(0.5 . -1) "Key change." Staff.KeySignature
    \key c \minor
    q
  }
}

[image of music]

Custom marks can be used as alternatives to numerical marks, and the annotation line joining the marked object to the mark can be suppressed:

\book {
  \header { tagline = ##f }
  \markup "footnotes with custom marks"
  \markup \null
  \relative c' {
    \footnote "*" #'(0.5 . -2) \markup { \italic "* The first note" }
    a'4 b8
    \footnote \markup { \super "$" } #'(0.5 . 1)
      \markup { \super "$" \italic " The second note." } e
    c4
    \once \override Score.Footnote.annotation-line = ##f
    b-\footnote \markup \tiny "+" #'(0.1 . 0.1)
      \markup { \super "+" \italic " Editorial." } \p
  }
}

[image of music]

More examples of custom marks are shown in Footnotes in stand-alone text.


LilyPond Notation Reference v2.25.21 (development-branch).