I wanted to create a setup, where I can generate a full score as well as each part and separate registers using lilypond. For the most part, my setup works fine, however I have some issues transposing the midi output for the different instruments correctly.
Here is the setup:
- In my source material I always have the instrument pitch available for each part (meaning the notes the person playing a certain instrument sees)
- The full score in my source material also displays the same notes, so not the concert pitch
I think it woud be relatively easy to transpose everything to concert pitch (= c), but I want to output the sheet music as is since I will probably need this setup in the future.
So the question now is, how to transpose each part in a register output or the full score output according to the instrument?
Here is what I tried so far (example with a part of the clarinet register).
version "2.24.3"
include "_global_definitions.ly"
include "clarinet_eb.ly"
include "clarinet_1.ly"
include "clarinet_2.ly"
header {
instrument = "Clarinets"
}
book {
bookOutputName "register_clarinets"
score {
midi {
context Staff = "pitch_es" {
transposition es
}
context Staff = "pitch_bes"{
transposition bes
}
}
<<
new StaffGroup = "StaffGroup_clarinets" <<
new Staff="pitch_es" {
set Staff.midiInstrument = "clarinet"
clarinet_eb
}
new Staff="pitch_bes" {
set Staff.midiInstrument = "clarinet"
clarinet_two
}
>>
>>
}
}
This does transpose something (i have tested this with A-B sound tests), but sounds horrible so my guess is something with the context references is wrong. The actual notes in clarinet_eb
and clarinet_two
should be correct, I have checked those multiple times now.