Le 14/12/2022 à 21:00, Kieren MacMillan a écrit :
Hi Jean,I totally agree that the \instrumentSwitch and \addInstrumentDefinition functions are useless. Just use variables. (Contrary to what its name suggests, \instrumentSwitch isn't directly related to Instrument_switch_engraver.)Please take a look at https://github.com/openlilylib/snippets/tree/master/editorial-tools/auto-transpose and how \addInstrumentDefinition is incorporated there. Would you say variables are still better in that use case?
Yes. Don't you find ebClarinet = \displayMusic { \clef "treble" \transposition ees \set Staff.shortInstrumentName = "Es-Kl" \set Staff.midiInstrument = "clarinet" \set Staff.instrumentCueName = "Es-Kl" } easier to write and read than \addInstrumentDefinition #"eb-clarinet" #`((instrumentTransposition . ,(ly:make-pitch 0 2 -1/2)) (shortInstrumentName . "Es-Kl") (clefGlyph . "clefs.G") (middleCPosition . -6) (clefPosition . -2) (instrumentCueName . "Es-Kl") (midiInstrument . "clarinet")) ? You can *always* convert any use of \addInstrumentDefinition / \instrumentSwitch by turning \addInstrumentDefinition "x" #`((prop1 . val1) (prop2 . ,val2) ...) \instrumentSwitch "x" into x = { \set Staff.prop1 = #'val1 \set Staff.prop2 = #val2 ... } but with the latter syntax, you can also use any command and not just \set Staff. ...
OpenPGP_signature
Description: OpenPGP digital signature