Remove named chords from MIDI output: Difference between revisions
Appearance
No edit summary |
m New category |
||
| Line 32: | Line 32: | ||
[[Category:Midi]] | [[Category:Midi]] | ||
[[Category:Chords]][[Category:Snippet]] | [[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
}
}
}