Apologies in advance for the long post. I've tried many different ways of applying your advice without success...
Based on your advice to make notes self-consistent (either \transpose or \transposition, but not both), I initially tried eliminating
\transpose and (applying the same reasoning to clarinetNotes) tried the following:
\version "2.18.2"
trumpetNotes = \relative c'' {
\transposition bes
c4 |
c4 |
c4 |
c4 |
}
\addQuote "trumpet" \trumpetNotes
clarinetNotes = \relative c'' {
\transposition bes
g4 |
\quoteDuring #"trumpet" { s4 }
g4 |
g4 |
}
altoSaxNotes = \transpose c g \clarinetNotes
<<
\new Staff \with { instrumentName = "trumpet" } \trumpetNotes
\new Staff \with { instrumentName = "clarinet" } \clarinetNotes
\new Staff \with { instrumentName = "alto sax" } \altoSaxNotes
>>
The trumpet and clarinet parts are fine. The alto sax part correctly transposes beats 1, 3 and 4, but the 2nd beat prints a C instead of a G.
So, I thought maybe it had to do with 'altoSaxNotes = \transpose ...', so I tried it by having altoSaxNotes quote the clarinet part as follows:
\version "2.18.2"
trumpetNotes = \relative c'' {
\transposition bes
c4 |
c4 |
c4 |
c4 |
}
\addQuote "trumpet" \trumpetNotes
clarinetNotes = \relative c'' {
\transposition bes
g4 |
\quoteDuring #"trumpet" { s4 }
g4 |
g4 |
}
\addQuote "clarinet" \clarinetNotes
altoSaxNotes = {
\transposition ees
\quoteDuring #"clarinet" { s1 }
}
<<
\new Staff \with { instrumentName = "trumpet" } \trumpetNotes
\new Staff \with { instrumentName = "clarinet" } \clarinetNotes
\new Staff \with { instrumentName = "alto sax" } \altoSaxNotes
>>
Again, the trumpet and clarinet parts are correct. The alto sax part correctly prints beats 1, 3 and 4, but beat 2 is missing/invisible.
Ok, so you said the other way you suggested to make notes self-consistent was to use \transpose and eliminate \transposition. However, based on your later statement that (paraphrasing) "\transposition must be correct in the passage being quoted into", I don't think it would be correct to remove \transposition from inside the clarinetNotes. Ya, I know that introduces self-consistency problem with clarinetNotes (see further on). Anyway, this is what I tried:
\version "2.18.2"
trumpetNotes = \transpose c bes \relative c'' {
c4 |
c4 |
c4 |
c4 |
}
\addQuote "trumpet" \trumpetNotes
clarinetNotes = \transpose c bes \relative c'' {
\transposition bes
g4 |
\quoteDuring #"trumpet" { s4 }
g4 |
g4 |
}
altoSaxNotes = \clarinetNotes
<<
\new Staff \with { instrumentName = "trumpet" } \transpose bes c { \trumpetNotes }
\new Staff \with { instrumentName = "clarinet" } \transpose bes c { \clarinetNotes }
\new Staff \with { instrumentName = "alto sax" } \transpose ees c { \altoSaxNotes }
>>
Again, the trumpet and clarinet parts are correct (well, the quoted note in the clarinet part is up an octave, but I could deal with that if that was the only issue). Beats 1, 3 and 4 of the alto sax part print correctly, but beat 2 is a (high) C instead of a G.
So, going back to the concept of self-consistency in clarinetNotes, I tried it with \transposition but not \transpose:
\version "2.18.2"
trumpetNotes = \transpose c bes \relative c'' {
c4 |
c4 |
c4 |
c4 |
}
\addQuote "trumpet" \trumpetNotes
clarinetNotes = \relative c'' {
\transposition bes
g4 |
\quoteDuring #"trumpet" { s4 }
g4 |
g4 |
}
altoSaxNotes = \transpose c g \clarinetNotes
<<
\new Staff \with { instrumentName = "trumpet" } \transpose bes c { \trumpetNotes }
\new Staff \with { instrumentName = "clarinet" } \clarinetNotes
\new Staff \with { instrumentName = "alto sax" } \altoSaxNotes
>>
Same result. Trying it with quoting into altoSaxNotes instead of explicit \transpose:
\version "2.18.2"
trumpetNotes = \transpose c bes \relative c'' {
c4 |
c4 |
c4 |
c4 |
}
\addQuote "trumpet" \trumpetNotes
clarinetNotes = \relative c'' {
\transposition bes
g4 |
\quoteDuring #"trumpet" { s4 }
g4 |
g4 |
}
\addQuote "clarinet" \clarinetNotes
altoSaxNotes = {
\transposition ees
\quoteDuring #"clarinet" { s1 }
}
<<
\new Staff \with { instrumentName = "trumpet" } \transpose bes c { \trumpetNotes }
\new Staff \with { instrumentName = "clarinet" } \clarinetNotes
\new Staff \with { instrumentName = "alto sax" } \altoSaxNotes
>>
Trumpet and clarinet parts print correctly (would need to fix octavation on the 2nd beat of the clarinet part). The alto sax part prints beats 1, 3 and 4 correctly, but beat 2 is invisible/missing.
I'm kind of out of ideas along these lines, so I also tried your suggestion of changing the \addQuote to include transposition, even though "that seems really backwards". Here it is:
\version "2.18.2"
trumpetNotes = \transpose c bes \relative c'' {
\transposition bes
c4 |
c4 |
c4 |
c4 |
}
\addQuote "trumpet" \transpose bes c \trumpetNotes
clarinetNotes = \transpose c bes \relative c'' {
\transposition bes
g4 |
\quoteDuring #"trumpet" { s4 }
g4 |
g4 |
}
altoSaxNotes = \clarinetNotes
<<
\new Staff \with { instrumentName = "trumpet" } \transpose bes c { \trumpetNotes }
\new Staff \with { instrumentName = "clarinet" } \transpose bes c { \clarinetNotes }
\new Staff \with { instrumentName = "alto sax" } \transpose ees c { \altoSaxNotes }
>>
Results: trumpet and clarinet parts print correctly. Alto sax is correct on beats 1, 3 and 4, but beat 2 prints C instead of G.
I suppose there are a few permutations I haven't tried, but given that the constant in all of these is that \quoteDuring doesn't seem to correctly survive multiple transpositions (whether explicitly with \transpose or implicitly due to quoting into a piece with a different \transposition), I'm suspecting a bug in lilypond. Something along the lines of losing track of the effective \transposition of a quoted part in the face of further transpositions.
Anyway, sorry for the long post, and I appreciate any/all help.
-Russ