Ossia-System mit InstrumentName

Begonnen von Malte, Dienstag, 21. August 2018, 17:27

« vorheriges - nächstes »

Malte

Hallo allerseits,

ich möchte ein Ossia-System mit einem InstrumentName beschriften. Das tut aber nicht wie gewünscht, auch
\override InstrumentName.break-visibility = #all-visible
hat keinen Effekt gezeigt:
\version "2.19.82"

\new Staff = "orig" \with {
instrumentName = "orig."
} \relative {
R1
<<
R1
\new Staff \with {
alignAboveContext = "orig"
instrumentName = "ossia"
shortInstrumentName = "o."
} {
r4 r r r
}
>>
}

Ist da was zu machen, hat jemand eine Idee?

Viele Grüße
Malte

harm6

Hallo Malte,

der IntrumentName.stencil ist definiert als `system-start-text::print` in output-lib.scm.
Dort wird ausdrücklich ausgeschlossen, daß er in der Mitte einer Zeile gedruckt werden könnte.

Ich hab auf der internationalen Liste schon mal den Code unten vorgeschlagen:


\version "2.19.82"

#(define-public (my-system-start-text::print grob)
  (let* ((orig (ly:grob-original grob))
         (siblings (if (ly:grob? orig)
                       (ly:spanner-broken-into orig) '() ))
         (long-text (ly:grob-property grob 'long-text #f))
         (text (ly:grob-property grob 'text #f)))   
    (cond ((and long-text
                (pair? siblings)
                (equal? grob (car siblings)))
             (grob-interpret-markup grob long-text))
          ((and text
                (pair? siblings)
                (member grob (cdr siblings)))
             (grob-interpret-markup grob text))
          (else (ly:grob-suicide! grob)))))
       
\layout {
  \override Staff.InstrumentName.stencil = #my-system-start-text::print
}

\score {
  \new StaffGroup
  <<
    \new Staff = "1" \with { instrumentName = "Top" shortInstrumentName = "t " }
      \repeat unfold 40 c'1

    \new Staff \with { instrumentName = "Bottom" shortInstrumentName = "b " }
      {
        d'
        d'
        <<
            \repeat unfold 38 d'
            \new Staff = "2"
              \with {
            instrumentName = "staff 2"
            shortInstrumentName = "s2 "
                alignAboveContext = "1"
              }
              { 
                e'
                e'
              <<
                  \repeat unfold 36 e'
                  \new Staff
                    \with {
                    instrumentName = "staff 3"
                    shortInstrumentName = "s3 "
                      alignAboveContext = "1"
                    }
                  \repeat unfold 36 f'
               >>
              }
          >>
      }
   
  >>
}


\new Staff = "orig" \with {
instrumentName = "orig."
} \relative {
R1
<<
R1
\new Staff \with {
alignAboveContext = "orig"
instrumentName = "ossia"
shortInstrumentName = "o."
} {
r4 r r r
}
>>
}


Siehe:
http://lilypond.1069038.n5.nabble.com/Instrument-Name-Not-Appearing-td207797.html

Dort auch Kritik zu meinem Ansatz, sowie eine alternative Lösung von Robin Bannister.


HTH,
  Harm

Malte

Vielen Dank für deine Antwort! Und sorry, daß ich jetzt erst antworte ... Tatsächlich funktioniert aus irgendeinem Grund deine Lösung in meinem konkreten Anwendungsfall nicht (es erscheint kein Name, ich habe gerade keine Zeit, herauszufinden, woran das liegt), aber Robins Lösung paßt in meinem Fall auch ganz gut, die hätte ich wohl ohne deinen Hinweis nicht gefunden :)

harm6

Hallo Malte,

würd' mich schon interessieren warum es mit meinem Coding nicht klappt.
Kannst Du ein minimal posten sobald die Zeitnot nicht mehr so arg ist?

Gruß,
  Harm

Malte

Ja, das probier ich dann mal. Kann aber ne Weile dauern.