Remove named chords from MIDI output: Difference between revisions
Appearance
Import snippet from LSR |
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 |
||
| Line 7: | Line 7: | ||
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. | 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. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
%% http://lsr.di.unimi.it/LSR/Item?id=783 | %% http://lsr.di.unimi.it/LSR/Item?id=783 | ||
Revision as of 18:53, 16 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
}
}
}