# LilyPond - setting different staff-sizes for different scores in "2.18"

I'm truing to use different staff sizes for different scores or at least book-parts in LilyPond "2.18.2".

There is a question on here about setting the staff-size globally, which does not solve my problem. The answer is linking to the "2.19" sollution in which you can use the #(layout-set-staff-size NN) within a \layout block. This does not work in "2.18.2":

\version "2.18.2"

\score {
\relative c' {
c4( d e f
g1) \bar "|."
}
\layout {
#(layout-set-staff-size 24)
}
}

\score {
\relative c'' {
g4( f e d
c1) \bar "|."
}
\layout {
#(layout-set-staff-size 10)
}
}


gives this output:

Is there a way to use different staff sizes in "2.18.2"?
it was ok if I could set an individual staff size at least for a \bookpart {}.

• This isn't a problem specific to 2.18. It also misbehaves in 2.19. I was able to get some of what you want by using these commands, but I found when playing with various permutations that this too doesn't behave consistently. So I'm not going to post a general answer yet, as I'm not quite sure what's going wrong with the internal commands (and don't have time right now to sort it out). But in the meantime, maybe that link can help. Dec 8 '19 at 21:20
• @Athanasius just found that layout-set-staff-size is already suggested in the "2.18.2" docs, did not know this...
– nath
Dec 10 '19 at 7:04

I found a Snippet with a function in the LilyPond Snippet Repository(LSR):

\version "2.18.2"

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)
#})

\score {
\new Staff        % default size
\relative c' {
c4( d e f
g1) \bar "|."
}
\layout {}
}

\score {
\new Staff \with { \staffSize #-4 }

\relative c'' {
g4( f e d
c1) \bar "|."
}
\layout {}
}


it does not change the staff-sizes for whole \bookpart blocks, but serves the purpose, even though it does look a little bit streched.

Note: the \with { \staffSize #-4 }needs to be added to every single \new Staff:

\version "2.18.2"

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)
#})

melody = \relative c'' {
\repeat unfold 3 {
g4( f e d)
e2 e
}
g8( f e d c d e f)
g( f e d c d e f)
g( f e d c2)~
c1 \bar "|."
}

basscl = \relative c' {
\clef bass
\repeat unfold 3 {
g2 e
e c
}
g1
d
f2. c4~
c1 \bar "|."
}

\score {
\new StaffGroup \with {
instrumentName = "minus 4"}
<<
\new Staff \with { \staffSize #-4 }
\melody
\new Staff \with { \staffSize #-4 }
\basscl
>>
\layout {}
}

\score {
\new StaffGroup \with {
instrumentName = "default"}
<<
\new Staff
\melody
\new Staff
\basscl
>>
\layout {}
}

\score {
\new StaffGroup \with {
instrumentName = "plus 4"}
<<
\new Staff \with { \staffSize #4 }
\melody
\new Staff \with { \staffSize #4 }
\basscl
>>
\layout {}
}


also the distance between the staffs gets smaller and smaller the bigger the score gets and vice versa. This needs to be tweaked manually. No ideal solution at all.