Le 11 févr. 08 à 02:07, Han-Wen Nienhuys a écrit :

[...]

- If I'm reading this correctly, this is all a grand hack to add a
little staff to an instrument name.   I don't see the essential
difference between this and

 \set instrumentName = \markup { \score { .. } the-real-name }

except that this is longer, more error prone and less flexible. Again,
what problem are you trying to solve?

The problem I was trying to solve is to separate the definition
of the instrument name, from the one of the incipit. They are not
the same thing, and should be entered separetely. It's well enough
to explicitely write
  \set instrumentName = \markup { \score { .. } the-real-name }
when you have a single piece to typeset. It really sucks when you
have hundreds. (I have more than 600 pieces that would use this
incipit thing.)

...

Actually, if there were ly:score-add-output-def! (or an optional
output-def argument to ly:make-score) and ly:output-def-set-variable!
functions, all could be done entirely from the outside.

Example:

\score {
  \new Staff {
      %% All this would be shortcuted by an appropriate music function:
\override Staff.InstrumentName #'music = ##{ \clef "petrucci- c1" c'4 d' e' f' #}
      \override Staff.InstrumentName #'self-alignment-X = #RIGHT
      \override Staff.InstrumentName #'self-alignment-Y = #UP
      \override Staff.InstrumentName #'Y-offset = #4
      \override Staff.InstrumentName #'padding = #0
      \override Staff.InstrumentName #'stencil =
      #(lambda (grob)
         (let* ((instrument-name (ly:grob-property grob 'long-text))
                (layout (ly:output-def-clone (ly:grob-layout grob)))
                (music (make-music 'SequentialMusic
'elements (list (make-music 'ContextSpeccedMusic
                                         'context-type 'MensuralStaff
;;'property-operations '((remove "Time_signature_engraver")) 'element (make-music 'PropertySet 'symbol 'instrumentName 'value instrument- name))
                                   (ly:grob-property grob 'music)))))
           (ly:output-def-set-variable! layout 'indent 0)
           (ly:output-def-set-variable! layout 'line-width 20)
           (ly:output-def-set-variable! layout 'ragged-right #f)
           (set! (ly:grob-property grob 'long-text)
                 (markup #:score (ly:make-score music layout)))
           (ly:system-start-text::print grob)))

      %% the instrument name definition is separated:
      \set Staff.instrumentName = "Violon"
      c'4 d' e' f' g'1
    }

  \layout {
    ragged-right = ##t
    indent = 5\cm
  }
}

==>

<<inline: incipit4.tiff>>




That would address the points you raised in your answer.
Are you ok with this (much less enormous) patch?

nicolas

Attachment: incipit-helper-functions.patch
Description: Binary data




_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to