[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why the whole bar rests wider and can't I change the width?
From: |
lilypond |
Subject: |
Re: Why the whole bar rests wider and can't I change the width? |
Date: |
Wed, 11 Aug 2021 14:26:58 +0200 |
I’m not sure what you mean by too wide. Lilypond handles full bar rests like
this: Each full measure rest attempts to have about the same width as the
measures next to it. But if space is required, it will be compressed to what
length you need. So the reason why Lilypond does not use smaller full bar
rests in your example is because there is no need for it. If you force a
tighter horizontal Spacing so that Lilypond can in fact fit two of your
complicated measures on one staff you will see that the full bar rests will be
compressed to make that possible.
That being said, if you want to force Lilypond to use tighter rests, you could
use \newSpacingSection before and after the rest so that each of these parts
handles spacing separately. This is probably not a very good idea in most
cases. Another way to force the rest to take a different spacing would be
adding hidden notes that force a different spacing.
E.g. in your case you could do
<< R4*5 \new Voice { \hideNotes r1 r4 } >>
To achieve the spacing you wanted. You could even assign
fbr = << R4*5 \new Voice { \hideNotes r1 r4 } >>
Then you only need to call \fbr, or if you want to span multiple measures you
could do
mbr =
#(define-music-function (n) (number?)
#{
<< R4*#(ly:make-moment (* 5 n))
\new Voice { \hideNotes \repeat unfold $n { r1 r4 } } >>
#})
To simply do \mbr 3 to get three full bar rests.
Of course this is a hack and limited, and only really useful when you want
exact control over the width of the rest.
Cheers,
Valentin
signature.asc
Description: This is a digitally signed message part.