Setting MIDI block properties

The \midi block can contain context rearrangements, new context definitions or code that sets the values of certain properties.

\score {
  … music …
  \midi {
    \tempo 4 = 72
  }
}

Here the tempo is set to 72 quarter note beats per minute. The tempo mark in the \midi block will not appear in the printed score. Although any other \tempo indications specified within the \score block will also be reflected in the MIDI output.

In a \midi block the \tempo command is setting properties during the interpretation of the music and in the context of output definitions; so it is interpreted as if it were a context modification.

Context definitions follow the same syntax as those in a \layout block;

\score {
  … music …
  \midi {
    \context {
      \Voice
      \remove Dynamic_performer
    }
  }
}

This example removes the effect of dynamics from the MIDI output. Note: LilyPond’s translation modules used for sound are called ‘performers’.

See also

Learning Manual: Other sources of information.

Notation Reference: Expressive marks, Score layout.

Installed Files: ly/performer-init.ly.

Snippets: MIDI.

Internals Reference: Dynamic_performer.

Known issues and warnings

Some MIDI players do not always correctly handle tempo changes in the midi output.

Changes to the midiInstrument, as well as some MIDI options, at the beginning of a staff may appear twice in the MIDI output.


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