lilypond-user
[Top][All Lists]
Advanced

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

Re: Single Whole Measure Rest vs compressed MMR


From: Thomas Morley
Subject: Re: Single Whole Measure Rest vs compressed MMR
Date: Mon, 4 Mar 2013 23:09:59 +0100

2013/3/4 Xavier Scheuer <address@hidden>:
> On 28 February 2013 01:05, Thomas Morley <address@hidden> wrote:
>>
>> Hi Xavier,
>>
>> do you think of sth like this:
>>
>> (snip)
>>
>
> Hi Thomas,
>
> Thank you for your answer.
> I did not use the 'bound-padding property but I was overriding MMR
> 'minimum-length to different values corresponding to my needs.
>
> Your 'bound-padding solution is interesting.  I'm not used to
> 'before-line-breaking (and 'after-line-breaking) overrides and its
> rather "cryptic" scheme expressions as values.

Hi Xavier,

'bound-padding and 'minimum-length are not the same, but seem to work
similiar here. Good to know both.

Actually there is no need to use 'before-line-breaking here. Setting
the 'minimum-length diectly works (see code below).
I'm used to start such coding by using the 'before-line-breaking or
'after-line-breaking-properties, because these properties offer a
wider range of possibilities.
And I don't think it's very cryptic.
The example from the Extending-manual has nearly the same structure.
http://lilypond.org/doc/v2.16/Documentation/extending/callback-functions

Well, ok, I know there are several "scheme-haters"  ...

Here a modified, commented code:

\version "2.16.2"

mmrLngth =
\override MultiMeasureRest #'minimum-length =
  #(lambda (grob) ;; 'minimum-length is set to a scheme-procedure,
starting here.
    ;; Defining some local variables.
    (let* (;; Read-out the 'measure-count-property.
           ;; Call it "measure-count"
           (measure-count (ly:grob-property grob 'measure-count))
           ;; Choose different numbers depending on measure-count.
           ;; Call it "lngth"
           (lngth (if (> measure-count 1)
                      30        ;; bound-padding for compressed MMR
                      15)))     ;; bound-padding for single MMR
   ;; Set the 'minimum-length-property to "lngth"
   ;; via the predefined `ly:grob-set-property!`
   (ly:grob-set-property! grob 'minimum-length lngth)))

\relative c' {
     \mmrLngth
     \compressFullBarRests
     R1*20
     R1
}


Regards,
  Harm



reply via email to

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