Hi Kieren,

I think the most natural way to do this would be to define a scheme function, which generates an output def, so that the following two examples would have the same result:


%%%%%%%%%%%%%%%%%%%
\version "2.19.47"

\score {
  \new Staff \with {
    instrumentName = \markup \fontsize #3 "Flute"
    shortInstrumentName = \markup \fontsize #-2 "Fl."
  }
  { 1 \break 1 }
}

nameInstrument =
#(define-scheme-function (long short) (string? string?)
   (ly:make-output-def
    ;;; do whatever it takes to make an output def with the above content…
    ))

\score {
  \new Staff \nameInstrument "Flute" "Fl." { 1 \break 1 }
}
%%%%%%%%%%%%%%%%%%

David K. recently made it possible to use multiple \with blocks per context creation, so that could easily be combined with other modifications to the Staff.

Unfortunately, ly:make-output-def is totally opaque, even looking at the definition in the source doesn’t give me (ok, I don’t know any C++) the slightest hint how to use it. What’s more, one cannot use \displayScheme on a with block… so I need to ask for others to chime in here – it can’t be too complicated, can it?

Best, Simon

On 21.09.2016 16:08, Kieren MacMillan wrote:
Hello all,

Has anyone elegantly solved the problem of having different font settings 
(size, in particular) for instrumentName and shortInstrumentName? I know I 
could write a music function, and then use

     instrumentName = “long name”
     shortInstrumentName = \myfunction ”short name”

or even just use

     instrumentName = “long name”
     shortInstrumentName = \markup \fontsize #-2 ”short name”

etc., but I’d prefer a global solution that can be set as a context override.

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


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to