lilypond-user
[Top][All Lists]
Advanced

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

Re: vertical spacing of rests


From: 70147persson
Subject: Re: vertical spacing of rests
Date: Tue, 25 Aug 2015 11:20:36 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

Den 2015-08-23 00:01, skrev Peter Selinger:
Hello again,

this is a true newbie question. I am trying to engrave two polyphonic
voices on a single staff. Since the two voices have all their rests in
common, I only want to typeset each rest once, so I use spacer rests
in the second voice. Still the vertical spacing is such that all the
rests are put near the top of the staff. I would like them to appear
in their "normal" positions.

>From the manual, I know two ways to do this. Solution 1 is to enclose
each rest between \oneVoice and \voiceOne, forcing standard vertical
spacing:

  \version "2.19.25"
  
  \new Staff <<
    \new Voice \relative c'' {
      \voiceOne {
        \oneVoice r \voiceOne c \oneVoice r \voiceOne d
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      }
    }
    \new Voice \relative c'' {
      \voiceTwo {
        s4 a8 a8 s4 b8 b8
      }
    }
  >>

Solution 2 is to specify an explicit vertical position for each rest.

  \version "2.19.25"
  
  \new Staff <<
    \new Voice \relative c'' {
      \voiceOne {
        b4\rest c b\rest \voiceOne d
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%
      }
    }
    \new Voice \relative c'' {
      \voiceTwo {
        s4 a8 a8 s4 b8 b8
      }
    }
  >>

Neither solution is particularly elegant, as they both require every
rest to be marked up individually. Is there a global way to turn off
vertical spacing for rests in a context, i.e., some command whose
effect would be to make notes behave as with \voiceOne and rests
behave as with \oneVoice?

Thanks, -- Peter




Hello,
There might be another aspect of positioning (common) rests from different voices. This is beside all the technical solutions presented earlier in this thread. All these work more or less fine for half rests as well as full rests. But when it comes to full rests, in almost every note sheet I have come in contact with, it is printed hanging below staff line number two, not zero, so the half rest and full rest reside in the same white space.

You can not have different definitions for these two rests, except for individual rests (\once \override...). But if you need a full rest, at least I prefer the multi measure rest (R1 instead of r1) as this is automatically centred in the measure. This type of rest also has its own definition of the vertical position. So the definition of centerRests should be:

centerRests = {
   \override Rest.staff-position = ##t
   \override MultiMeasureRest.staff-position = #2
}

Regarding the voice VoiceTwo, I use to convert the rests into spaces, which is quite simple by means of the global replace function (ctrl+H) in Frescobaldi and the regular _expression_ (Regex) option. Replace "([ ])r([^a-zA-Z]*)" with "\1s\2)" (remove the quotation marks, they are here just for pointing out the text to insert). For non English works the exclude text (a-zA-Z) might have to be expanded, not to affect comments and similar texts.

Kaj

reply via email to

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