lilypond-user
[Top][All Lists]
Advanced

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

Re: Horizontal positioning of rests


From: David Wright
Subject: Re: Horizontal positioning of rests
Date: Thu, 1 Sep 2016 22:09:06 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu 01 Sep 2016 at 20:49:04 (+0000), Karen Billings wrote:
> Hi all,
> Sorry to bother you with a beginner's problem... I have been using Lilypond 
> for about a year now, and all that time I have had problems with rest 
> positioning. I've been dealing with it, but it's becoming more of a problem 
> now that trying to read multi-line scores...
> The documentation states that rests are, by default, always centered 
> horizontally.  For some reason, mine always end up left-justified.  What am I 
> doing wrong and how can I correct it?
> I've attached a picture of the problem, along with my .ly file (version 
> 2.18.2).

NM p53 says "Whole measure rests, centered in the middle of the
measure, must be entered as multi-measure rests. They can be used for
a single measure as well as many measures and are discussed in [Full
measure rests], page 55."

Only that type of rest will center.

David K has pointed out your use of stemUp etc. This is because you're
trying to manually do what \voiceOne, \voiceTwo etc can do for you
automatically.

I've commented out the things you no longer need. However, you'll
notice that one new problem arises: the *vertical* placement of
rests. They're fine when only one voice has a rest, but you get two
stacked rests when both have a rest.

One way of countering that is to put a rest in one part, a skip in the
other, and either use manual height adjustment (you know how to do
this already) or prefix rests with \oneVoice and suffix with \voiceXxx.

This is tedious, and doesn't work if you ever want to set the parts
on four staves instead of two, eg, when a bit of counterpoint crops up.

Better is to use the code from here:

 %% Merges ordinary rests when they're the same in two parts on a stave.

 %% http://lsr.dsi.unimi.it/LSR/Item?id=336
 %% see also http://code.google.com/p/lilypond/issues/detail?id=1228

(I hope those references are up-to-date.)

Unfortunately, multimeasure rests are a different beast from ordinary
ones and have to be treated separately. I add:

 %% Because this code doesn't handle multimeasure rests, this hack is
 %% included here, which fixes multimeasure rests on their normal line:

 mmrest = { \once \override MultiMeasureRest.staff-position = #2 }

 %% and is used thus: \mmrest R1 \mmrest R1 * 9/8 etc.

to the top of the scheme code in the .ily file.

BTW note that I put the \voiceOne in the \score structure, not in
the oneSop definition. This enables you to use the same oneSop
definition in both two or four stave \scores.

Cheers,
David.

Attachment: diess-snip.ly
Description: Text document

Attachment: diess-snip.pdf
Description: Adobe PDF document


reply via email to

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