lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deprecation of instrumentCueName and instrument switch stuffs


From: Jean Abou Samra
Subject: Re: Deprecation of instrumentCueName and instrument switch stuffs
Date: Wed, 14 Dec 2022 21:15:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1



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. ...

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]