3.6.5 Using MIDI instruments

MIDI instruments are set using the midiInstrument property within a Staff context.

\score {
  \new Staff {
    \set Staff.midiInstrument = "glockenspiel"
    … music …
  }
  \midi { }
}

or

\score {
  \new Staff \with {midiInstrument = "cello"} {
    … music …
  }
  \midi { }
}

If the instrument name does not match any of the instruments listed in the ‘MIDI instruments’ section, the acoustic grand instrument will be used instead. See MIDI instruments.

See also

Learning Manual: Other sources of information.

Notation Reference: MIDI instruments, Score layout.

Installed Files: ‘scm/midi.scm’.

Known issues and warnings

Percussion instruments that are notated in a DrumStaff context will be output, correctly, to MIDI channel 10 but some pitched, percussion instruments like the xylophone, marimba, vibraphone or timpani, are treated as “normal” instruments so the music for these should be entered in a Staff (not DrumStaff) context to obtain correct MIDI output. A full list of channel 10 drum-kits entries can be found in ‘scm/midi.scm’. See Other sources of information.


LilyPond — Notation Reference v2.23.82 (development-branch).