lilypond-user
[Top][All Lists]
Advanced

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

Re: Condensing single-bar rests into a multi-measure rest


From: David Sumbler
Subject: Re: Condensing single-bar rests into a multi-measure rest
Date: Sat, 03 Jan 2015 17:45:36 +0000

> From: Urs Liska <address@hidden>
> To: address@hidden
> Subject: Re: Condensing single-bar rests into a multi-measure rest
> Date: Sat, 03 Jan 2015 16:45:27 +0100
> 
> Am 03.01.2015 um 16:36 schrieb David Sumbler:
> > I have now finished setting the saxophone quartet, which is the first
> > substantial multi-instrument piece I have attempted with Lilypond.
> >
> > I am very pleased with the result, and I am now at the stage of tweaking
> > the appearance of the output.
> >
> > Searching in the Lilypond documentation, one problem I have not been
> > able to find a solution to is this: in the piece there are a few places
> > where one instrument is silent for several consecutive bars.  In the
> > score these obviously appear as single bar rests, but in the relevant
> > instrumental part I should like them to appear as a "multi-measure
> > rest".
> >
> > The problem may be that I have used \parallelMusic for the whole score:
> > this seems an obvious way of doing things for a piece such as this with
> > a small number of instruments.  It has certainly been far easier to find
> > my way around the file than in my previous Lilypond efforts (e.g. a
> > piece for flute and piano), even though they were a lot shorter than
> > this one.
> >
> > But looking at the documentation, I can only see multi-measure rests
> > appearing if they are entered as multi-measure quantities - e.g. R1*6.
> > If this is true, then the only way I can see to get the result I want,
> > would be to deconstruct my whole file and reassemble it as 4 separate
> > sections, one for each instrument.  This in itself will be a tedious
> > chore, but it also means the resulting file(s) will be much less easily
> > navigable when I make further additions and modifications.
> >
> > Is there any way to get the result I want whilst still keeping the
> > \parallelMusic layout?
> 
> LilyPond by default only interprets single entities as combinable rests 
> (i.e. R1*6), while consecutive rests (e.g. R1 R1) are separated by 
> \compressFullBarRests.
> 
> I recently had the same problem and got a file from the list which I 
> tweaked to work well in a quite similar case.
> You can find the file at
> https://git.ursliska.de/beautifulscores/das-trunkne-lied/blob/master/library/ly/to-lilylib/combineMultimeasureRests.ily
> 
> I'm not sure if it is really straightforward to use in other contexts 
> but I suspect you should be able to use it.
> You have to remove the conditional expression in the last function 
> \combineMMRests (because that's project specific), but I expect the file 
> to work smoothly once you've done that.
> 
> To use it include the file and surround your music by \combineMMRests 
> \yourMusic.
> 
> HTH
> Urs

Thanks for that.  I have tried the file, and although it does not
produce any errors, it does not seem to change the output at all.  So it
may be that I am doing something wrong.  Here is what I have done.

Firstly, the final function now reads:

combineMMRests =
#(define-music-function (parser location music) (ly:music?)
       (condense music)
       music)

I'm not entirely sure I have got this right!

Secondly, in the section of my main file which produces a part for a
instrument, I have:

\score {
        \combineMMRests {
                \myMusic
        }
        \layout {
        }
}

Is this correct?

At the top of my file, of course, I have:

\include "combineMultimeasureRests.ily"

David




reply via email to

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