Hi, >> Rather, one should simply be able to say [something >> like] >> >> clarinets = { >> \takeInstrument #”clar.Bf” >> %% Bb clarinet music here >> \takeInstrument #“clar.A” >> %% A clarinet music here >> } >> >> and all scores (transposing and concert-pitch) should Do The Right >> Thing™, with perhaps a few parameters/switches to help as necessary. > > To support switching between instruments of different transpositions, I > wonder if we could cook up a Scheme function that postprocesses a music > expression and wrap sub-expressions within the appropriate \transpose > blocks based on a running state associated with the Staff (or Voice). > For example, we might make it so that you could write: > > clarinetPart = { > \set Staff.autoTransposition = bes > ... % concert pitch music here > > \markup "Switch to A clarinet" > \set Staff.autoTransposition = a > ... % more concert pitch music here > > \markup "Switch to B\flat clarinet" > \set Staff.autoTransposition = bes > ... % yet more concert pitch music here > } > > clarinetMusic = \autoTranspose \clarinetPart
I think we’re saying the same thing. My hypothetical \takeInstrument syntatic sugar would put the desired markup, \set the autoTransposition, and a number of other things, as set in some \addInstrument (or other) definition. > I think something like these would be a valuable addition to the > standard \include library. Agreed. I’ve been offering to sponsor this for nearly a decade — hopefully it happens soon! Thanks, Kieren. ________________________________ Kieren MacMillan, composer ‣ website: www.kierenmacmillan.info ‣ email: i...@kierenmacmillan.info _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user