• Willkommen im Forum „Archiviertes Lilypond Forum (2017)“.
 

Dies ist das Archiv des alten Forums (bis März 2017). Das aktuelle Forum ist unter lilypondforum.de zu finden.
This is the archive of the old forum (until March 2017). You can find the current forum at lilypondforum.de.

Hauptmenü

Text in volta-Klammern

Begonnen von chf, Montag, 16. September 2013, 19:25

Vorheriges Thema - Nächstes Thema

chf

Liebe Freunde,

wie ihr seht, habe ich schon was gefunden (2011),
allerdings mache ich wohl etwas falsch...

Gruß
chf

harm6

Hallo Christa,

Du hast vergessen
  \set Score.repeatCommands =
in der zweiten Klammer zu setzen. Wahrscheinlich ein copy/paste-error.

Ich mußte Deinen Code allerdings erst mal in eine leserliche Form bringen bevor ich das Problem finden konnte.
Es ist mir ein Rätsel wie irgendjemand, einschließlich Dir selber, da den Überblick behalten kann.

Folgendes funktioniert jedenfalls:

\version "2.17.19"

voltaOne = \markup { \text \fontsize #2 \bold "1.– " }

voltaTwo = \markup { \text \fontsize #2 \bold "Fine" }

\relative c'' {
  \time 4/2
  \repeat volta 2 {
    f2 g a4. (g8 f4) e
  }
  \alternative {
    {
      \set Score.repeatCommands =
        #(list (list 'volta voltaOne))
      d\breve
    }
    {
      \set Score.repeatCommands =
        #(list (list 'volta #f) (list 'volta voltaTwo) 'end-repeat)
      d\breve
    }
  }
  \bar "|."
}


Btw, Du gibst 2.17.19 an. Falls Du schon eine devel-version gebrauchst, dann würde ich immer die neueste nehmen,
z.Zt. 2.17.26


Gruß,
  Harm

harm6

Nachtrag:

Du könntest auch die Erkenntnisse aus diesem Thread benutzen, insbesondere meine Antwort hier.

Das führt zu:

\version "2.16.2"

setRepeatCommand =
#(define-music-function (parser location arg)(scheme?)
#{
  \applyContext #(lambda (ctx)
   (let* ((where (ly:context-property-where-defined ctx 'repeatCommands))
          (repeat-commands (ly:context-property where 'repeatCommands))
          (to-append
            (cond ((symbol? arg)
                   (list arg))
                  ((or (boolean? arg) (markup? arg))
                   (list (list 'volta arg)))
                  (else '()))) 
          (appended-settings (append repeat-commands to-append)))
    (ly:context-set-property! where 'repeatCommands appended-settings)))
#})

% startRepeat = \setRepeatCommand #'start-repeat
endVolta = \setRepeatCommand ##f
endRepeat = \setRepeatCommand #'end-repeat

voltaOne = \setRepeatCommand \markup { \text \fontsize #2 \bold "1.– " }
voltaTwo = \setRepeatCommand \markup { \text \fontsize #2 \bold "Fine" }

\relative c'' {
  \time 4/2
  \repeat volta 2 {
    f2 g a4. (g8 f4) e
  }
  \alternative {
    {
      \voltaOne
      d\breve
    }
    {
      \endVolta
      \endRepeat
      \voltaTwo
      d\breve
    }
  }
  \bar "|."
}


Gruß,
  Harm

chf

Hallo Harm,

es ist immer wieder schön, wenn das Brett vorm Kopf einen Riss kriegt...
Danke!
Die Variante in "2.16.2" scheitert wieder and den zusammenstoßenden Klammern. Deshalb verwende ich in solchen Fällen jetzt "2.17..."
Sonst bleibe ich noch "stabil".

Gruß
Christa