lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:\bookparts and scaling (Karlin High)


From: Cynthia Karl
Subject: Re:\bookparts and scaling (Karlin High)
Date: Sat, 30 Jun 2018 16:46:38 -0500

> 
> Message: 2
> Date: Fri, 29 Jun 2018 13:18:18 -0500
> From: Karlin High <address@hidden>
> To: address@hidden, David Wright <address@hidden>,
>       address@hidden
> Cc: address@hidden, David Kastrup <address@hidden>
> Subject: Re: \bookparts and scaling
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> On 6/29/2018 10:46 AM, David Wright wrote:
>> software is more like a work of art that has to be sculpted into perfection,
>> which takes time, trouble and effort.
> 
> Okay, moving in that direction.
> 
> The documentation could be updated to better reflect the current state 
> of these staff-size commands.
> 
> Or, would it be possible to have a command that does what the OP 
> expects? Namely, applying the effect of set-global-staff-size to 
> bookparts individually and independently, whether via 
> layout-set-staff-size or something else.
> 
> I can poke around some more at that 
> layout-set-absolute-staff-size-in-module thing in paper.scm, but it 
> would be nice to have some input from someone who actually understands 
> these internals, about whether that approach is likely to succeed.

Unfortunately, I cannot claim to be that someone who actually understands these 
internals.  However, ever since someone posted a scheme function called 
“staffSize”, I have no problems with staff sizes.

Here is the staffSize function:

% Define staves, e.g., so:  \new Staff \with {\staffSize #4 } 

staffSize = #(define-music-function (new-size) (number?)
#{
  \set fontSize = #new-size
  \override StaffSymbol #'staff-space = #(magstep new-size)
  \override StaffSymbol #'thickness = #(magstep new-size)
#})

An example of its usage:

music = { … }

\score {
  new StaffGroup \with { \staffSize #0 } <<
    \new Staff \with { \staffSize #4 } \music
    \new Staff \music
    \new Staff \with { \staffSize #-4 } \music
  <<
}

This score block will produce a pdf with a group of three staves, the first one
at 24 pts, the second one at the default 20 pts (inherited from the StaffGroup 
\with
block), and the third one at 16 pts.

It appears that each occurrence of \score in a book resets the staff size to 
the default 20 pts.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]