Remove named chords from MIDI output: Difference between revisions
Appearance
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series |
m New category |
||
| (One intermediate revision by the same user not shown) | |||
| Line 33: | Line 33: | ||
[[Category:Midi]] | [[Category:Midi]] | ||
[[Category:Chords]] | [[Category:Chords]] | ||
[[Category:Snippet]] | |||
Latest revision as of 23:27, 21 November 2025
When using a \new Chordnames {} section, chords will be included in MIDI output. When chord names are only included to ease reading but should not sound, possibly because they are already included in the score, this is a problem.
The sound can be changed using \set Chordnames.midiInstrument = "(whatever)", but cannot be removed by using a non-existent instrument: Lilypond will default to acoustic grand in such a case.
The solution is to act at the MIDI level instead of the Chordnames: remove the MIDI performer used for that specific voice.
Note that the working part of the snippet is not visible in the generated score. This is as should be, since this is only about MIDI behaviour.
\version "2.24"
%% http://lsr.di.unimi.it/LSR/Item?id=783
\score {
<<
\new ChordNames {
\chordmode {
d:min
}
}
\new Staff {
d'4 f'4 a'4 d''4
}
>>
\layout {
}
\midi {
\context {
\ChordNames \remove Note_performer
}
}
}