• 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ü

Templates für Staff

Begonnen von ingmar, Dienstag, 8. September 2015, 21:22

Vorheriges Thema - Nächstes Thema

ingmar

Ich beziehe mich auf den Thread \markup-Funktion mit Argument?. Mir scheint das Folgende ein ganz ähnlicher Fall, hat aber nix mit \markup zu tun. Aber vielleicht gibt es auch eine ganz andere, einfachere  Lösung.

Ich möchte zwei verschiedene Staff-Größen verwenden:
\version "2.18.2"

MUSIC-I = \relative c'' { c4 d e f g1 }
MUSIC-II = \relative c' { c4 b c d e1 }
MUSIC-III = \relative c { c4 g c g c1 }

\score {
\new StaffGroup { <<
\new Staff \with {
instrumentName = "erstes"
fontSize = #-4
\override StaffSymbol.staff-space = #(magstep -4)
\override StaffSymbol.thickness = #(magstep -4)
} { \clef "violin" \MUSIC-I }

\new Staff \with { instrumentName = "zweites" } { \clef "alto" \MUSIC-II }

\new Staff \with {
instrumentName = "drittes"
fontSize = #-4
\override StaffSymbol.staff-space = #(magstep -4)
\override StaffSymbol.thickness = #(magstep -4)
} { \clef "bass" \MUSIC-III }
>> }
}

Offensichtlich ist es unübersichtlich und fehlerträchtig, jedesmal diese umständlichen, aber stets gleichen Größenbeschreibungen ausführen zu müssen. Ich stelle mir vor, in einer Art Stylesheet den \with-Teil vorzuhalten und anschließend nur schreiben zu müssen:

\new Staff \with { \SMALLSIZE \instrumentName = "zweites" } { \clef "violin" \MUSIC-I }
\new Staff \with { \REGULARSIZE \instrumentName = "zweites" } { \clef "alto" \MUSIC-II }
\new Staff \with { \SMALLSIZE \instrumentName = "drittes" } { \clef "bass" \MUSIC-III }

...oder so ähnlich.

Wie fange ich das am besten an?

Danke, Gruß, : - )
--ingmar      

harm6


\version "2.18.2"

%%http://lsr.di.unimi.it/LSR/Item?id=862

staffSize = #(define-music-function (parser location new-size) (number?)
  #{
    \set fontSize = #new-size
    \override StaffSymbol.staff-space = #(magstep new-size)
    \override StaffSymbol.thickness = #(magstep new-size)
  #})
 
SMALLSIZE =
\with { \staffSize #-4 }

REGULARSIZE = {}

\version "2.18.2"

MUSIC-I = \relative c'' { c4 d e f g1 }
MUSIC-II = \relative c' { c4 b c d e1 }
MUSIC-III = \relative c { c4 g c g c1 }

\score {
\new StaffGroup { <<
\new Staff \with {
instrumentName = "erstes"
fontSize = #-4
\override StaffSymbol.staff-space = #(magstep -4)
\override StaffSymbol.thickness = #(magstep -4)
} { \clef "violin" \MUSIC-I }

\new Staff \with { instrumentName = "zweites" } { \clef "alto" \MUSIC-II }

\new Staff \with {
instrumentName = "drittes"
fontSize = #-4
\override StaffSymbol.staff-space = #(magstep -4)
\override StaffSymbol.thickness = #(magstep -4)
} { \clef "bass" \MUSIC-III }
>> }
}

\new StaffGroup <<
  \new Staff \with { \SMALLSIZE instrumentName = "erstes" } { \clef "violin" \MUSIC-I }
  \new Staff \with { \REGULARSIZE instrumentName = "zweites" } { \clef "alto" \MUSIC-II }
  \new Staff \with { \SMALLSIZE instrumentName = "drittes" } { \clef "bass" \MUSIC-III }
>>


HTH,
  Harm