lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme function to affect a compound music expression?


From: David Nalesnik
Subject: Re: Scheme function to affect a compound music expression?
Date: Sat, 25 Oct 2014 11:27:12 -0500

Hi again, Peter--

On Sat, Oct 25, 2014 at 11:01 AM, Peter Crighton <address@hidden> wrote:
2014-10-25 17:51 GMT+02:00 David Nalesnik <address@hidden>:
Hi Peter,

On Sat, Oct 25, 2014 at 10:41 AM, Peter Crighton <address@hidden> wrote:
I now wanted to improve the function to also skip MultiMeasureRests and first tried replacing 'rest-event with 'multi-measure-rest-event to see if that would work, which it doesn’t.


Yes, this was a stumbling block for me too recently.  It doesn't seem that you can use 'multi-measure-rest-event with music-is-of-type?

Turns out that you can use music-is-of-type? to get what you want.

See:

http://lilypond.org/doc/v2.18/Documentation/internals/multimeasurerestmusic

for the list of types of MultiMeasureRestMusic.

So you can use the following:

bgr = #(define-music-function (parser location music) (ly:music?)
  (music-map (lambda (mus)
    (if (or (music-is-of-type? mus 'rest-event)
            (music-is-of-type? mus 'multi-measure-rest))
 
%%%

--David

reply via email to

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