Am 4. Januar 2015 01:16:23 MEZ, schrieb David Sumbler <da...@aeolia.co.uk>: >From: Urs Liska <u...@openlilylib.org> >To: lilypond-user@gnu.org >Subject: Re: Condensing single-bar rests into a multi-measure rest >Date: Sat, 03 Jan 2015 18:59:17 +0100 >> > >Am 03.01.2015 um 18:45 schrieb David Sumbler: >>> From: Urs Liska <u...@openlilylib.org> >>> To: lilypond-user@gnu.org >>> 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! > >No, that's not right. The "result" of a Scheme function is the result >of >the last expression, and that is "music" in your case, so you're >returning the unaltered music argument. > >I think (without testing) that > >combineMMRests = >#(define-music-function (parser location music) (ly:music?) > (condense music)) > >should be 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? > >That looks correct, although you don't need the curly braces around >\myMusic in this case. > >However, I don't know if parallelMusic is interfering here >additionally. > >HTH >Urs > >I have now corrected my version of the combineMMRests function, but >unfortunately it still leaves my output unaffected. > >I can see how something like this could work - unfortunately my >understanding at this stage of Scheme and Lilypond internals is >insufficient for me to see where the problem might be or to write >something similar from scratch. > >I can't see why \parallelMusic should cause a problem: presumably it >just returns exactly what the individual parts would produce if they >were not interleaved in the parallelMusic structure. > >David > >
But you do have the \compressFullBarRests somewhere? Urs >_______________________________________________ >lilypond-user mailing list >lilypond-user@gnu.org >https://lists.gnu.org/mailman/listinfo/lilypond-user _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user